Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Google's Chrome browser (and Chromium) stores the saved passwords in a encrypted sqlite database where it is pretty safe. However, if the user is logged into Chrome, it is merely a matter of a few mouse clicks to reveal the passwords.

Because of that I would like to make a script that will automatically log me out of Chrome based on certain criteria, such as when my Linux PC is connected to a foreign network (which would be the case if it were stolen).

The script itself is not my main problem. What I don't know, however, is how to force Chrome to log me out using the command line.

Is that possible?

share|improve this question
It sounds like you want to avoid losing all your passwords if your computer ever gets stolen. Logging out of Chrome isn't the answer to this. – harbichidian Sep 23 '13 at 22:43
It is part of the answer. There are more safety precautions such as a encrypted home folder. – marlar Sep 24 '13 at 7:35

You should consider other more general security measures to protect the data of a running or suspended system:

  • (automatically) lock your sessions when away from keyboard,
  • encrypt your home directory or partition,
  • encrypt the suspend image (dm-crypt, uswsusp, or tuxonice will do the job),
  • encrypt the swap partition (dm-crypt), and
  • use one or multiple strong pass phrases or even a smartcard in all of the above instances.

At this point it doesn't matter much, if the browser still has the master key in memory.


If someone steals your notebook, he would have to guess your key, break the encryption, or analyse the memory content in case of a live system. The latter two are considered very difficult to achieve, whereas the difficulty of the first depends on the complexity of your key.

share|improve this answer

use an external password program that can be set up with requiring a passcode generated by an app on your smartphone, or that can send a text with a one time password to access their database. My personal preference is LastPass.

pkill can be used to kill off processes - if you set up chrome to not remember your login details when starting a new session, this would be sufficient (settings > content settings > manage exceptions > add pattern: > dropdown: clear on exit)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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