When in the graphical environment, seahorse unlocks my ssh key (locked with a passphrase) so I can ssh to another host without entering a passphrase.

But when on the command line, I am still asked for such a passphrase.

Is there a way to have ssh-agent unlock my key on login the way seahorse does? Also, what is the proper way to start ssh-agent on login?

1 Answer 1

sudo apt install keychain

and add

if [ -z "$TMUX" ] ; then
    keychain -q ~/.ssh/id_rsa;
. ~/.keychain/$(hostname)-sh 2> /dev/null

to ~/.bashrc


  • But I already have ssh-agent installed, as well as seahorse, wouldn't in be a third key agent?... Can't I just use ssh-agent? Besides, does seahorse use ssh-agent/gpg-agent to manage ssh/gpg keys or does it bring its own agent with it?
    – Ninguém
    Commented Jan 4, 2021 at 20:02
  • @Ninguém "keychain - re-use ssh-agent ... between logins" you can use just ssh-agent if you want to be asked for a password on every login. Commented Jan 4, 2021 at 20:16
  • Hum! In that case...
    – Ninguém
    Commented Jan 4, 2021 at 20:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .