How to retrieve your passwords saved in Google Chrome or Chromium on ubuntu linux

If you are like me, you have loads of passwords saved in the Chrome browser. And then you need them. Maybe you want to stop using Chrome, or you want them to enter into some applcation other than the browser… or perhaps you just want a list of all sites you have passwords for – curiosity… whatever the reason, it isn’t easy to discover how to do this.

This solution is based on one I found at The Big Browser with two very minor changes where that code didn’t work for me.

Before beginning, make sure you are signed in from your Google Chrome or Chromium browser and your passwords are synced and available.

Close the browser.

Next, open the browser from the command line, with a temporary profile that stores passwords without encryption. Like so (pick one of the lines depending on the browser you are using)

### Google Chrome
    google-chrome --user-data-dir=/tmp/chrome-tmp --password-store=basic

### Chromium
    chromium --user-data-dir=/tmp/chrome-tmp --password-store=basic

This did not work for me – I use Chromium. I had to use this:

### Chromium
    chromium-browser --user-data-dir=/tmp/chrome-tmp --password-store=basic

I have no idea what happens with Google Chrome, but if the given line doesn’t work, appending -browser to google-chrome is worth a try.

This will open a separate session. Sign in to the browser with your account and wait for a while till your passwords are synchronized. You can surf if you want. When your data is syncronized, your saved websites and bookmarks will be available. You can go to “Manage passwords” in settings and see that your passwords are loaded. If you don’t see them, wait some more time till you do.

Close the browser.

Note: the fastest way to get to the stored passwords page in settings is to type password in the Search box in the top right.

In the terminal, enter:

cd /tmp/chrome-tmp/Default

For the next step, you will need sqlite3 installed. If it isn’t installed, you can install it by entering:

sudo apt-get install sqlite3

Then enter:

sqlite3 'Login Data'

At the changed prompt, now enter the following lines one by one.

.mode csv               # other options are `html', `tabs', etc.
.headers on
.separator ","
.output chrome_passwords.csv
select * from logins;
.exit

This will give you a file called chrome_passwords.csv with your Chrome passwords.

To open it with LibreOffice, type:

libreoffice --calc chrome_passwords.csv

The passwords will open as a spreadsheet. You also will be able to import this spreadsheet into other keyword managers if you need to.


Posted

in

,

by

Tags:

Comments

4 responses to “How to retrieve your passwords saved in Google Chrome or Chromium on ubuntu linux”

  1. confiq Avatar
    confiq

    Where are passworded stored in encrypted form? Database ‘Login Data’ is empty for me

    1. Vidyut Avatar
      Vidyut

      I don’t think you can recover encrypted passwords. You will have to follow the steps and sync them without encryption first.

  2. John Wesley Cooper Avatar
    John Wesley Cooper

    I probably am going to seem like the paranoid guy in the corner for saying this, but … I *never* sign into chrome, not because I don’t trust Google but because I don’t trust what might happen to my login data and such if someone were to hack into their datastores.

    As I understand it, the bottom line is this: the passwords are in some form of reversible encryption and thus they can be recovered. In fact, I do believe there is an easy way on Ubuntu for a legitimate user to see them using the Gnome Keyring (which is what’s used to encrypt them). As far as that goes, considering that I believe it can be configured to have a strong master password of its own it is probably more secure this way than it would be on windows … buuut, I can’t claim to be familiar with all the vulnerabilities out there right now.

    My personal recommendation would therefore be to not go through this process but instead retrieve the local passwords already on the system using Gnome Keyring, which would not lead to all your credentials getting spewn across the ‘net in bulk (possibly again, albeit with what is likely fairly strong encryption for transport) where someone could potentially pick them up somewhere along the line and eventually crack them.

  3. Amin Avatar
    Amin

    it worked for me. 🙂
    that’s great
    thanks for this tutorial

Leave a Reply to Vidyut Cancel reply

Your email address will not be published. Required fields are marked *