Sitemap

Member-only story

How to Setup Passwordless SSH Connect from Windows to Linux

2 min readOct 9, 2020
Press enter or click to view image in full size

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

ssh-keygen generates public/private rsa key pair

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!

--

--

Mert Ilis
Mert Ilis

Written by Mert Ilis

I’m a software development enthusiast who likes trying different web technologies and adding value to his team.