SSH question
Tobias Heinemann
theine at nordita.dk
Thu Jan 5 13:32: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.
I always use DSA encryption but if RSA works the same way, you will have
to do the following:
On the local machine you want to login from, do
ssh-keygen -t rsa
Under ~/.ssh there should now be two files called id_rsa and id_rsa.pub.
Copy the latter one to the remote server:
scp ~/.ssh/id_rsa.pub remote.server.com:
Log into the remote server via SSH:
ssh remote.server.com
Once logged in, add the public key to the list of authorized keys:
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
If you like, you can now delete the public key file:
rm ~/id_rsa.pub
That's it. Next time you log into your remote server via SSH, you
shouldn't be prompted for a password (unless you entered a passphrase
when creating the SSH key that is...)
Regards,
Tobi
More information about the ubuntu-users
mailing list