Generating Password-less Login Between 2 Linux Machines

A Password-less login using SSH keys will establish a trust relationship between 2 Linux machines which makes file synchronization, or file transfer very easier.

Server A = Source Server        Server B = Destination Server

  1. Connect via ssh to ServerA
  2. Type
    ssh-keygen -t dsa
    1. The default directory for keyfiles will be ~/.ssh/
    2. You will be asked for a passphrase, leave passphrase blank
  3. Type: 
ssh(ServerB IP)"mkdir .ssh && chmod 700 .ssh" && scp id_dsa.pub (ServerB IP:.ssh/authorized_keys
  1. (ServerB IP)’s password:
  2. (ServerB IP)'s password:
    1. This should appear
    ssh(“id_dsa.pub             100%  614     0.6KB/s   00:00 keys

 

  1. Type:  ssh (ServerB IP) and you will be able to log in from now on without using a password