If you are annoyed to remember the passwords of your remote servers just like me, Then this post is for me and for you.
By adding the Public SSH key to the remote server you can connect to the server without any password.
All you need is to just add the public key to authorized machines on the remote server.
If you are using any Linux Operating system then you can generate your new public SSH key with this following command.
When you enter this command you will be prompted for location for the key to be saved and password, If you want protect you can enter the password. and If you don’t want and want to have password less login into the server you can leave blank and continue.
and you can add your ssh key directly to the remote server from here.
cat ~/.ssh/id_rsa.pub | ssh [email protected]/ipaddress 'cat >> .ssh/authorized_keys'
Here is another way you can add the ssh key to your server
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
This is the best way I like to add my key to the server.