21

When we prompt our browser to save credentials once we log into a web application, they store our corresponding username and password. I know to recover these things from my browser. But I want to know to which directory in Ubuntu these passwords are stored?

  • 4
    It depends on the browser... top 3 are in my answer, if you need another browser PM me. Though I would assume most Linux based browser will use the same methods as Chromium. – Rinzwind Sep 17 '14 at 8:02
  • Which browser?? – Braiam Sep 17 '14 at 14:12
30

Chromium and chrome

Store passwords in three ways:

  1. GNOME Keyring
  2. KWallet 4
  3. plain text

Chromium chooses which store to use automatically, based on your desktop environment.

Passwords stored in GNOME Keyring or KWallet are encrypted on disk, and access to them is controlled by dedicated daemon software. Passwords stored in plain text are not encrypted. Because of this, when either GNOME Keyring or KWallet is in use, any unencrypted passwords that have been stored previously are automatically moved into the encrypted store.

Source for chromium

The manual page for google chrome (man google-chrome) shows:

--password-store=<basic|gnome|kwallet>
          Set the password store to use.  The default is to  automatically
          detect  based  on  the  desktop  environment.  basic selects the
          built in,  unencrypted  password  store.   gnome  selects  Gnome
          keyring.  kwallet selects (KDE) KWallet.  (Note that KWallet may
          not work reliably outside KDE.)

Chrome uses the same method as Chromium. And you can use above setting to switch to plain text passwords (not recommended of course).


Chrome (older versions)

Passwords are stored in ~/.config/google-chrome/Default/Login\ Data and that is a sqlite database file (that file is encrypyed).

This login database file is in SQLite format which is lighter version of popular SQL database. In addition to login credentials it also stores other information such as auto complete entries, IE7 Logins, search keywords etc. The 'logins' table is where all the login or sign-on secrets are stored by Chrome. This table contains following interesting fields

Origin_URL - Base URL of the website
Action_URL - Login URL of the website
Username_element - Name of the username field in the website
Username_value - Actual username
Password_element - Name of the password field in the website
Password_value - Encrypted password
Date_created - Date when this entry is stored
Blacklisted_by_user - Set to 1 or 0 based on if website is blacklisted or not.

Except the password field all other fields are entered in clear text. The password for all stored websites is encrypted using Triple DES algorithm seeded with logged on user's password. That means login secrets cannot be decrypted across the user or system boundaries unless under certain conditions.

Source 1 and source 2


Firefox

See ~/.mozilla/firefox/<profilename>

The files you are looking for are signons.sqlite, which is the database with the passwords, and key3.db, which is where the master passwords and encryption keys are stored.

Both files are encrypted. To view passwords you need to use the browser.

enter image description here

  • 2
    Chrome also uses the GNOME Keyring, if it's available (as anyone who's experienced the "The default keyring wasn't unlocked..." prompts will attest to). – muru Sep 17 '14 at 8:21
  • 1
    If you want a source, the man google-chrome says this: --password-store=<basic|gnome|kwallet> Set the password store to use. The default is to automatically detect based on the desktop environment. basic selects the built in, unencrypted password store. gnome selects Gnome keyring. kwallet selects (KDE) KWallet. (Note that KWallet may not work reliably outside KDE.) – muru Sep 17 '14 at 8:32
  • 7
    @muru darn it. I have been telling people to use "man"... and now I fall for it myself :D added! :D – Rinzwind Sep 17 '14 at 8:35

protected by Community Mar 14 '16 at 23:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.