Every time I SSH into another server from our headless Ubuntu server I am asked for the password to my key file. Even if I have previously connected to the server.
Do you have any idea why this maybe? It could be something as simple as ssh-agent
not currently running or something.
The same key on my Ubuntu Gnome desktop is working fine. Both server and desktop are running Ubuntu 10.10.
ps -ef | grep '[s]sh-agent'
simon 3219 1 0 12:46 ? 00:00:00 ssh-agent
Best Answer
Even if agent is up, if certain environment variables are not set, you have no reference to agent. Furthermore, even if it is all ok, agent and variables, the identity are not automatically sent to agent: that is a task for
ssh-askpass
, working only in X sessions.If you are using bash, create the file
~/.bash_profile
with this content:modify the file name
~/.ssh/id_dsa
following your needs, and add this line to~/.bash_logout
A last note: this do not interfere with a gnome session, because in that case only
~/.profile
is sourced, and you can benefit from thessh-askpass
graphical interface that ask for a passphrase and send it to thessh-agent
.