We all know SSH and have used it to connect to remote hosts.
The annoying thing about it (when using it frequently) is that you have to enter your password each time.
If you want to bypass that, as I wanted, keep reading..
- Firstly, on your local machine type this: ssh-keygen
- You will be prompted to “Enter file in which to save the key”
just hit [enter].If you don’t want to assign a pass phrase (press [enter] key twice). It will create 2 files in ~/.ssh directory as follows:
- ~/.ssh/id_rsa : identification (private) key
- ~/.ssh/id_rsa.pub : public key
- Now we want to secure copy the public key to the remote host.
We’ll do that with ssh-copy-id:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-host
- Finally, you are able to login to the remote host using ssh username@remote-host without typing your password.