Normally we can connect remote server using SSH (Secure SHELL) for managing or execute programs on Linux. Also support to transferring files from a server to another server. This post will help you how to login into your server without entering password. This SSH keys increase more secure connection between two or multiple Linux servers.
Do you like to an automatic login from server 192.168.0.1 as user xxx to 192.168.0.2 as user yyy without enter any password.
Login into your server IP address : 192.168.0.1 with user xxx, then generate a pair of authentication keys using command ssh-keygen
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
Generating public/private dsa key pair.
Created directory '/home/xxx/.ssh'.
Your identification has been saved in /home/xxx/.ssh/id_dsa.
Your public key has been saved in /home/xxx/.ssh/id_dsa.pub.
The key fingerprint is:
d7:c3:35:db:85:ab:87:7e:c2:44:a3:2d:49:7a:ea:4d xxx@192.168.0.1
The key's randomart image is:
+--[ DSA 1024]----+
| |
| . |
| + .|
| .oo. =.|
| So.=+.o .|
| ..= o+ |
| oE+o . |
| .o .o.. |
| .. . .o |
+-----------------+
Now, just create a directory to yyy user on 192.168.0.2
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.2' (RSA) to the list of known hosts.
yyy@192.168.0.2's password:
Finally append xxx generated new public key to yyy on 192.168.0.2 .ssh/authorized_keys,
Then, we set the permission on .ssh directory and authorized_keys,
Finally, connect remote server via ssh without entering password.
or
Comments (0)