I want the computer like pageant, to show a SSH password prompt during boot time. I have my private keys stored in a Dropbox between 3 computers of which 1 is now Ubuntu.

I have googled for 2 hours and asked other people, but most people simply do not use private keys at all or use private keys without passwords and therefore do not need something like this. I however use my same private key at multiple locations and renew it every year. It must be password-protected because it's on multiple locations and on my Dropbox.

I found Seahorse, although I am no sure it does what I want it to do, but it gives segmentation faults on a fresh Ubuntu install while importing a PuTTy key exported to OpenSSH.


4 Answers 4


Many Linux distributions will start the ssh-agent from the login manager by default. So really all you have to do is add your key after it is started.

So you could simply setup a shortcut script or something like that to run ssh-add as soon as you login. How you do that depends on which desktop environment you are using.

You can install GUI tools like x11-ssh-askpass, so the password prompt is presented in the GUI.

You can do things with PAM to get it to prompt you for a password, or simply re-use your login password.

Seahorse or other password wallets (1) (2) built into some desktop environments should work as well. I have no idea why it is crashing for you. You would need to add more details.


You should check two things:

  1. If you are working on a recent linux disto like ubuntu, you should already have ssh-agent compatible key-manager running on your system. Open a shell (under X11) and check the value of SSH_AUTH_SOCK environment variable. If it is something like /tmp/keyring-WEuO6X/ssh, you are running Gnome Keyring. If it is like /tmp/ssh-XXXXXXXXXX/agent.<ppid>, you are running ssh-agent and so on. If it is empty, you have no key-manager running.

  2. I suppose you store keys in a non-default directory (i.e. not under ~/.ssh). So your key-manager does not see them. Look at ssh-agent manual and try to do a soft link under ~/.ssh dir to your key. Something like ln -s $HOME/dropbox/.../mydsakey $HOME/.ssh/id_rsa (the exact file names depend on your key type). This should work with any key-manager but, after you determined which are you using, you can check for a more clean solution in its manual.

In any case, most key-managers will non ask you the key-phrase at login time but when you try to use the key for the first time in the session.

[ -- post scriptum -- ]

The simplest method to verify if you have a key-manager running is to try to add manually a key:

ssh-add <key-file>

With ubuntu and kubuntu I used ssh-agent with a self written script.

I installed putty:

sudo apt-get install putty

You need to create an id_rsa file in the .ssh folder of your home directory with ssh-keygen or convert from your *.ppk (puttygen generated file). The name id_rsa is important!

puttygen private.ppk -O private-openssh -o $HOME/.ssh/id_rsa

The id_rsa file must not be readable or writeable by others:

chmod 600 $HOME/.ssh/id_rsa

I created an agent.sh file in my home directory, but it can be placed anywhere:

. $HOME/.ssh/ssh-agent.env 2>/dev/null
if [ "`ssh-add -l | grep id_rsa`" = "" ]; then
  mkdir -p $HOME/.ssh/
  ssh-agent >$HOME/.ssh/ssh-agent.env
  . $HOME/.ssh/ssh-agent.env

You can execute putty with:

. ./agent.sh; putty


. ./agent.sh

The "." (point or period) is also important, it exports the environment variables of the executed script. At first time it will ask the password of your key file, the next time the putty will be executed without asking password.

  • +1 for the convert command. I don't need automatic key unlocking but converting the key solved my problem.
    – robsn
    May 30, 2016 at 7:44

Keychain is like ssh-agent (in fact, it is a sort of wrapper), but it keeps the same agent running across all processes.

keychain is a manager for ssh-agent, typically run from ~/.bash_profile. It allows your shells and cron jobs to share a single ssh-agent process. By default, the ssh-agent started by keychain is long-running and will continue to run, even after you have logged out from the system. If you want to change this behavior, take a look at the --clear and --timeout options, described below.

You must log in to answer this question.

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