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.

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

    1. Vidyut Post author

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

      Reply

Leave a Reply

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