6

The ssh-agent on my Mac causes a pop-up for certain hosts:

[me@my-laptop]$ ssh cargo2

Last login: Tue Aug  3 09:26:43 2010 from trainwreck.arlut.utexas.edu
[me@cargo2]$

But for other hosts:

[me@my-laptop]$ ssh red

And then I get the dreaded "Enter your password for the SSH key 'id_rsa'." pop-up. I know the ssh-agent is running and working because it worked for the first host.

How do I stop the pop-up for all hosts and make it always use the ssh-agent?

For reference:

$ ssh-add -l
2048 <hex value> /Users/me/.ssh/id_rsa (RSA)

$ ps aux | grep ssh-agent
me    1393   0.0  0.0  2445984   1572   ??  Ss    9:18AM   0:00.10 ssh-agent -s

$ env | grep -i ssh
SSH_AGENT_PID=1393
SSH_AUTH_SOCK=/tmp/ssh-UW4rDdw1jw/agent.1391
aaron
  • 543

4 Answers4

3

The same thing happened to me if ~/.ssh/id_rsa existed but ~/.ssh/id_rsa.pub did not, if you delete the pub file auth with the key still works but asks for your password every time

valexa
  • 141
2

It turns out that I had copied my id_rsa and id_rsa.pub files from another laptop. I copied the pub key to the servers I was trying to log into, and for some reason one of them accepted the key with a client hostname mis-match and the other did not.

To fix the problem I had to generate a new public/private key pair and distribute that.

aaron
  • 543
0

Do you use different identities for these two hosts set up in ~/.ssh/config (or elsewhere)?

If you have different identities, then one might not be configured in the OS X keychain. This blog entry (not mine, just found via google) discusses how keychain works with ssh-agent in OS X Leopard.

Doug Harris
  • 28,397
0

it worked for me on my mac lion with this command: rm ~/.ssh/*

http://om4.com.au/ssh-rsa-key-pairs-passphrases-leopard/