Last Updated: February 25, 2016
·
481
· shavit

SSH login without password

How To Login To Your Ubuntu Server Without A Password

On the local machine

# defaults to /home/username/.ssh/id_rsa.pub
$ ssh-keygen
$ scp ~/.ssh/id_rsa.pub username@SERVER_ADDRESS:~/

Connect to the production machine

$ ssh username@SERVER_ADDRESS

On the production machine

# defaults to /home/username/.ssh/id_rsa.pub
$ cd ~
$ ssh-keygen

*Notice: Do not copy your local key (id_rsa.pub) into the ~/.ssh directory by accident *

$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
$ rm ~/id_rsa.pub

You might need to restart the ssh server

$ service sshd restart

http://conpanna.net