I am logged in to host A.
I want to ssh to host B without giving a password.
I run ssh-keygen on A.
I copy-paste the public key file to B.
I attempt ssh from A to B. B asks for password.
What am I doing wrong?
(Leave aside that not using ssh-agent and passphrases is insecure.)
On Thu, 8 Aug 2002, Satya wrote:
I want to ssh to host B without giving a password. I run ssh-keygen on A. I copy-paste the public key file to B.
check that you're using the correct protocol version. are you using rsa or dsa? did you use the same protocol version for key generation and for connecting?
man ssh and man ssh-keygen hold the answers to these and other unasked questions.
+++ Satya [08/08/02 03:27 -0700]:
I am logged in to host A. I want to ssh to host B without giving a password. I run ssh-keygen on A. I copy-paste the public key file to B. I attempt ssh from A to B. B asks for password. What am I doing wrong?
Where did you paste to? The id-(r|d)sa.pub file goes to B:~/.ssh/authorized_keys2 and identity.pub goes to B:~/.ssh/authorized_keys
Permissions are important too, .ssh has to be 700, and authorized_keys? has to be 644, both owned by your user.
Devdas Bhagat
On Thu, Aug 08, 2002 at 07:14:38PM +0600, Devdas Bhagat wrote:
+++ Satya [08/08/02 03:27 -0700]:
I am logged in to host A. I want to ssh to host B without giving a password. I run ssh-keygen on A. I copy-paste the public key file to B. I attempt ssh from A to B. B asks for password. What am I doing wrong?
Where did you paste to? The id-(r|d)sa.pub file goes to B:~/.ssh/authorized_keys2 and identity.pub goes to B:~/.ssh/authorized_keys
Permissions are important too, .ssh has to be 700, and authorized_keys? has to be 644, both owned by your user.
Apart from all this, let me add that you need not have null passwords. You should check out ssh-add. A wonderful utility, which lets all children applications of ssh-agent to seamlessly use services over other hosts, asking for your passphrase just once when you run it.