SSH Passwordless Access

Suppose you are logged in machine A and you need passwordless access to an account on machine B.

(1) Create RSA keys:

ssh-keygen -t rsa -f B_key

This will create two files:  B_key and B_key.pub. The first is the private key and the second is the public key of the RSA protocol.

(2) Copy the contents of  B_key.pub into the file  authorized_keys in the  .ssh  directory of the remote account:

cat B_key.pub | ssh B_user@B_machine 'cat >> .ssh/authorized_keys'

(3) Login to machine B:

ssh -i B_key B_user@B_machine