[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh-add error

On 06/12/2012 02:09 PM, Carl Macmillan wrote:

I would like to know if ssh-add is working as it is intended:

here is what I did:
*mrdesk@desk ~/_pla $ ssh-add*
*Enter passphrase for /home/mrdesk/.ssh/id_rsa: *

here I entered nothing, the key does have, and was expecting a
passphrase...  ssh-add failed silently.

This is the expected behavior.
From "man ssh-add":
"Exit status is 0 on success, 1 if the specified command fails, and 2 if ssh-add is unable to contact the authentication agent."

So, you can explicitly test for failure like this:

$ ssh-add ~/.ssh/id_rsa || echo "failed"
Enter passphrase for /home/yourname/.ssh/id_rsa:


*mrdesk@desk ~/_pla $ ssh-add*
*Enter passphrase for /home/mrdesk/.ssh/id_rsa: *
*Identity added: /home/mrdesk/.ssh/id_rsa (/home/mrdesk/.ssh/id_rsa)*

here I typed the passphrase and it happily says it worked.

Can you tell me if the former silent error is intended? I'm kind of a
novice and found myself stuck for an hour on an ssh authentication failure
because I didn't realize the first effort was a failure, since it fails

*mrdesk@desk ~/_pla $ ssh -v *
*OpenSSH_5.9p1 Debian-5, OpenSSL 1.0.1 14 Mar 2012*

-Carl Macmillan

Reply to: