SSH Key Passwordless Authentication With Remote Servers

On your linux machine run the following command

You will be asked the below now. Save the key to the default path and then choose if you want to put a passphrase in. If you do you’ll have to enter it each time you use your key, if you don’t then depending on how you have your setup it *may* be less secure. I use other methods to lock down both my desktop and servers so I’m happy with no password for ease.

Now your private and public key are created you need to copy your public key to your remote server so that you can connect without password going forward. Run the following command to do this. You need ssh access to the server to do this so if it’s firewalled or turned off you’ll need to address that first. You can do the below for any linux user on the server, if you want to connect as a webspace user use that username, if you want to connect as root just use that username (also you’ll need to ensure direct root login is enabled if it isn’t).

You should get the following after issuing the command

Lastly check you can now login to your remote linux server without a password as it mentions by doing

If everything has worked correctly you should be able to connect to your remote server without login now.