This is how you can connect (ssh) from your Windows 10 machine to your Linux server (CentOS in my case) without entering the SSH password.
- First, open “PowerShell” and execute the following command to generate public/private RSA key pair:
ssh-keygen
You can click enter without entering anything for a default file location and empty passphrase.
- Your public key has been saved in C:\Users\[username]/.ssh/id_rsa.pub if you didn’t change the file location.
- Open id_rsa.pub with Notepad++ so that we can append the generated SSH public key to existing keys in the destination server.
- Connect to the destination server using ssh and your password from PowerShell.
- Open the “authorized_keys” file with vi:
vi ~/.ssh/authorized_keys
- Copy the contents of the “id_rsa.pub” (which was open in Notepad++) and append to the “authorized_keys” file in the Linux server.
- Save your changes in the Vi editor:
:wq
Now you can quit your ssh session and connect again but this time no password will be asked.
Hope it helps!