Passwordless login remote with SSH

generate the public keys

[email protected]> ssh-keygen –t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user1/.ssh/id_rsa.
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
The key fingerprint is:
31:a1:c2:d7:a6:9f:27:cd:84:1f:f2:7a:e8:7c:34:80

[email protected]> cd /home/user1/.ssh
[email protected]> cp id_rsa.pub authorized_keys

Copy the file authorized_keys to server2 and it is now possible to login without password.

[email protected]> cd /home/user1/.ssh
[email protected]> scp authorized_keys server2:/home/user1/.ssh

Published by

Asbjorn

Working in IT for longer that I care to remember and in more countries than is normal. Interests besides computers and programming are skiing, gardening, constructing electronics and having a good time.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.