Update: A simpler method is described in this stackoverflow.com post How can I export chrome passwords?
Having spent some time googling for a way to export Chrome passwords to an external file to my surprise I could not find a straightforward solution that would work irregardless of the version of Chrome/Chromium. Finally, this page provided a hint to a solution which worked for me.
Older versions of Chrome/Chromium for Linux stored unencrypted passwords in an SQLite database under:
# Google Chrome:
~/.config/google-chrome/Default/Login Data
# Chromium:
~/.config/chromium/Default/Login Data
In newer versions of Chrome this file is still present, but the passwords are not there anymore - they are stored using the encrypted password storage provided by the system, either Gnome Keyring or KWallet, which means that simply dumping the tables will not work. On OSX the Chrome passwords are in the system keychain, and can be viewed from System Keychain
The method below relies on forcing Chrome to use a temporary profile folder in combination with unencrypted password storage. This approach will not affect your current Chrome profile in any way.So, to export your passwords to a human readable text file:
- Connect to your Google Account in Chrome Settings so that your passwords are synched with the Google cloud storage. Make sure that you have ticked Passwords in Advanced Sync Settings.
- Wait for a while until the data is synched, and then close all the Chrome windows.
- Start Chrome using one of the two command lines below. Google Chrome has a green-red-yellow icon , while the Chromium icon is in shades of blue .
This will launch Chrome with a custom profile folder without affecting your current profile.# Google Chrome google-chrome --user-data-dir=/tmp/chrome-tmp --password-store=basic # Chromium chromium --user-data-dir=/tmp/chrome-tmp --password-store=basic
- Setup Google Synching for the new temporary profile and wait until everything is synced from the cloud, i.e. your bookmarks appear, extensions show up, the theme is applied, etc. Verify that the passwords are restored from the Google cloud by looking under Settings → Personal Stuff → Manage Saved Passwords. If they do not appear, then wait a couple of minutes more. 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.
- Exit Chrome.
- Next, open a terminal and change to the newly created Chrome profile
cd /tmp/chrome-tmp/Default
- Now, open the Login Data SQLite database using the sqlite3 command line utility and dump the logins table. For this to work, you need to have sqlite3 installed on your system.
sqlite3 'Login Data'
- Next, at the SQLite prompt enter the commands below. For help on available commands type .help at the prompt.
.mode csv # other options are `html', `tabs', etc. .headers on .separator "," .output chrome_passwords.csv select * from logins; .exit
Now you should have a file named chrome_passwords.csv containing all your Chrome passwords. To open it with LibreOffice, type:
libreoffice --calc chrome_passwords.csv
Great solution... Thanks.
ReplyDeleteJust great.
ReplyDeleteI've been searching for a solution 15 minutes and even tried to use a Windows tool with WINE - your solution took me exactly 1 minute and I've got my passwords back, even well formatted in an .csv file.
Thank you very much.
PS: I'm new to Linux and the Terminal but you managed to make it easy even for a n00b :-)
wow! thank you so much!
ReplyDeleteThe downside of this solution is that you share all your passwords with Google...
ReplyDeleteDoes anyone know any other way to decode Google Chrome entries in KWallet/Gnome Keyring?
Just wanted to pop in 3 years after the original post date to mention that not only does this method still work, three years later, for Chrome version 45.0.2454.85, it also saved my a** big time, so thanks OP! :)
ReplyDeleteQuick tip: After exiting Chrome, if you get an error in sqlite3 that says "error, database is locked" after running 'select * from logins;' it most likely means that Chrome is still running in the background.
You can confirm/change this setting by unchecking a box that allows Chrome to run in the background. The checkbox is located near the very bottom of the page of Chrome's advanced settings.
Cheers! :)
This comment has been removed by the author.
ReplyDeleteNow to be able to import them to Firefox? (Trying to move from Chrome to FF but need passwords)
ReplyDeleteHello.. your blog is great. I read your blog and like it very much. Thanks for sharing.
ReplyDeleteHow to Lock Google Chrome with Password