Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question
    
I assume you mean the OS X Keychain popup? Honestly, the thing is a godsend. But anyway… weird that some times you get it, some times you don't. –  kch Aug 3 '10 at 14:53
    
Related: superuser.com/questions/73387/… –  kch Aug 3 '10 at 14:57
    
Also, you probably want to do some reading under the Keychain Integration section here: dribin.org/dave/blog/archives/2007/11/28/ssh_agent_leopard –  kch Aug 3 '10 at 14:58
    
Lastly, you may want the reverse of this: superuser.com/questions/88470/… –  kch Aug 3 '10 at 15:00
1  
@aaron that's weird. Try searching for id_dsa/id_rsa. Did you manage to find your answer in any of the linked urls or do you still need help with this? –  kch Aug 6 '10 at 15:01
show 3 more comments

4 Answers

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

share|improve this answer
    
Thanks, this fixed the problem. I had to generate a new id_rsa.pub file. If you want to generate a new id_rsa.pub from id_rsa, run this command in your ~/.ssh folder: ssh-keygen -y -f id_rsa > id_rsa.pub (dzone.com/snippets/regenerate-idrsapub-key) –  Chris B Jul 11 '13 at 13:20
add comment
up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
    
I don't have a ~/.ssh/config file, and the system config files are the defaults that were installed a couple of days ago w/ the OS. I looked through /etc/ssh_config and everything is still commented out. –  aaron Aug 3 '10 at 17:28
add comment

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

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.