SSH question

Tim Littlemore tim at tjl2.com
Thu Jan 5 11:49:55 UTC 2006


David Mummery wrote:
> I'm trying to setup password-less SSH login using public/private keypair but am failing. All the documentation tells me to do the same thing but it does not work:
>
> On my remote machine, as root, I run:
>
> ssh-keygen -t rsa
>
> - Enter and confirm passphrase
>
> cp /root/.ssh/i_rsa.pub /root/.ssh/authorised_keys
>
> chmod 644 /root/.ssh/authorised_keys
>
> I then copy authorised_keys to the machine I want to connect from, as root, and put it into /root/.ssh/authorised_keys
>
> I then chmod 644 this file.
>
> Despite this, when I run 'ssh root at remote_host', as root, I am still asked for remote host's root password. I cannot see what I am doing wrong(!)
>   
You haven't mentioned loading up your key agent in this set of 
instructions. You will need to do this on your local machine:

# ssh-add
type your pass phrase when prompted
# ssh-agent

These two commands add your key to the key agent. You will need to do 
this every time you log in to your local machine before you can use keys 
(I do this first thing each morning at work).

You should then be able to ssh using your key (you will need to add the 
-A switch to the SSH command):

# ssh -A root at remote_host

Due to the fact that I always needed to add -A to my ssh commands to get 
this to work, I added an alias to my .bashrc file of the following:

alias ssh='ssh -A'

Also, as other people have mentioned, you need to spell authorised in 
the American style on your authorized_keys file.

Cheers,

Tim




More information about the ubuntu-users mailing list