LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh passphrase question (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-passphrase-question-929605/)

deep27ak 02-15-2012 11:16 PM

ssh passphrase question
 
Hello
OS : RHEL 5.2
I generated a RSA key using
Code:

#ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
1b:38:b5:b9:1b:8e:28:8a:da:04:3f:5d:25:1c:e6:6a root@server.example.com

And copied the id_rsa.pub key to hosts /root/.ssh/authorized_keys

but now when I try to ssh it still prompts me for the passphrase but I don't want it to ask any password or passphrase. As soon as I do ssh, the machine should connect to remote host.

Am I missing something?

chrism01 02-15-2012 11:38 PM

Did you give it a passphrase or just <Enter> at the prompt?

deep27ak 02-15-2012 11:50 PM

No, I have supplied a passphrase to it

Am I suppose to give a blank passphrase i.e just "enter"?

chrism01 02-15-2012 11:57 PM

Exactly; passphrase should be just <Enter> if you DON'T want one eg want to be able to automate cxns.
Passphrase is basically a passwd to access the relevant auth-key: its optional

suicidaleggroll 02-16-2012 12:04 AM

And if that doesn't work, it's possible the permissions on the authorized_keys file are jacked:

Code:

chmod 750 ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

If the permissions aren't right, ssh won't use the file.

deep27ak 02-16-2012 12:10 AM

Thanks chrism01

That did the trick :)

True enough suicidaleggroll
But if it is prompting me for passphrase then it surely means that ssh is able to read the authorized_keys file.
If it would have been a permission issue it wouldn't have prompted me for passphrase in the first case but yes it plays its part for not allowing any other users to make any change in this file.


All times are GMT -5. The time now is 11:48 AM.