I have everything set up so that after I log in and add proper identity to ssh-agent using ssh-add from a gnome-terminal window, I do not have to enter the passphrase again when I invoke ssh myserver.
Now I wanted to make it even easier and create a panel launcher that would run
gnome-terminal --command "ssh myserver"
but while this does invoke what I want, it ignores ssh-agent, i.e. it asks for pass-phrase. And it does so every time, even if I supply the PP, the next time it asks again.
What am I doing wrong? Can anybody explain why this does not work?
Further notes:
Running
gnome-terminal --command "ssh myserverfrom already open terminal works OKChanging
ssh myserverpart tobash -c "ssh myserver"with proper quoting did not help.Also using
ssh myserverright in the launcher did not help: the pass-phrase prompt was displayed as a simple GUI window (unless I checked "Run in terminal" option, in which case the behavior was same as described above)It's Ubuntu 12.04
adding -vvv to both ssh command, here is where the failing (and asking for PP) ssh starts to differ from the successful ssh:
[...] debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: fp 5e:ad:5e:1f:7f:... debug1: key_parse_private_pem: PEM_read_PrivateKey failed debug1: read PEM private key done: type <unknown> Enter passphrase for key '/home/lennycz/.ssh/id_rsa':while the successful ssh says
[...] debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: fp 5e:ad:5e:1f:7f:... debug1: Authentication succeeded (publickey). [...](and then lot of things apparently unrelated...)
I haven't found any helpful debug messages around nor anything in system/auth logs.

ssh-keygen -t rsafor the client machine, then to copy the key to the remote system, I runssh-copy-id <username>@<hostname>, assuming RSA and standard port 22. If not standard, there's a slight variation. I've used the ssh-agent method for cygwin in the past, but never needed it for Ubuntu for a long time. – Marty Fried Dec 10 '12 at 22:55ssh myserverworks from previously opened terminal window). My problem is about ssh-agent, specifically that ssh, when invoked via launcher does not use it while ssh invoked from terminal window does. – Alois Mahdal Dec 10 '12 at 23:39