SSH Password-less Login

The below example, describe how to set up SSH password-less automatic login from server A to B with user user.

Create Authentication SSH-Keygen Keys on A

ssh-keygen -t rsa

Create .ssh Directory on B

ssh uesr@B mkdir -p .ssh

Upload Generated Public Keys to B

cat .ssh/id_rsa.pub | ssh user@B 'cat >> .ssh/authorized_keys'

Set Permissions on B

ssh user@B "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

Login from A to B without Password

ssh user@B