SSH login without password
You want to log in to a server via SSH but it asks your password each time. How to log in without password?
The process is detailed here. Here I just sum up the steps.
I will call “client” my home machine from where I want to log in to the server. The “server” is the target machine where I want to log in. Here are the steps to follow:
Generate a pair of public keys:
ssh-keygen -t rsa -b 4096 -C "email@example.com"
When it asks something, just press Enter, i.e. don’t provide a passphrase. It will create the file “
Log in to the server. Open the file “
~/.ssh/authorized_keys” (or create it, if it doesn’t exist yet), and append to its end the content of “
~/.ssh/id_rsa.pub” from the client! In other words, copy the content of “
~/.ssh/id_rsa.pub” on the client to the clipboard, and paste it to the end of “
~/.ssh/authorized_keys” on the server.
On the server, set the rights correctly!
$ chmod 700 ~/.ssh $ chmod 640 ~/.ssh/authorized_keys
Log out from the server. Now, if you try to log in via ssh, it won’t ask your password.