Hi Everyone,
I would like to share my basic experience about how to set SSH between machine without password. This method can be useful when you decide to use MPI (Message Passing Interface) or to do parallel processing amount machine that are connected each others.
Let we assume name and IP Address of our machine for making simple description.
Server1 : server1@111.111.111.111
Server2 : server2@222.222.222.222
Suppose we have two machine that we want to connect each other. First, we access Server1 using SSH which provided by PUTTY or other ssh client.
Host Name (or IP Address) : 111.111.111.111
Port : 22
Connection type: SSH
When the login prompt, we will be asked username and password. After success login, we create ssh key by typing:
Server1:~$ ssh-keygen -t rsa
By default this will be generate public key which is saved in ~/.ssh/id_rsa.pub and private key which is saved in ~/.ssh/id_rsa. Now, copy the id_rsa.pub to the Server2 and append it to ~/.ssh/authorized_keys by entering:
Server1:~$ ssh-copy-id server2@222.222.222.222
We will be asked password. Now we can try to login into Server2 by typing:
Server1:~$ ssh 222.222.222.222
If success, you will be not asked password and can login directly.
No comments:
Post a Comment