Passwordless SSH Authentication on Windows - jwells24/Tech-Journal GitHub Wiki
Passwordless SSH Authentication - Windows to Linux
The goal of this task is to create a passwordless SSH session between a windows box and a linux box. The first goal is to create a key in windows. Ensure you have openssh installed and enabled, or install it with this guide: https://www.techrepublic.com/article/how-to-install-the-openssh-server-on-windows-with-powershell/. To generate a key, we need to open powershell and use the following command:
You will be asked to complete a few prompts, then your key will be successfully generated. The key will automatically be saved to C:\Users\localaccount/.ssh/id_rsa.pub. The next step is copying your key over to your linux system. At this point, check with firewall rules and make sure SSH is enabled back and forth between the Windows System and the Linux system. Now, copy the key to the linux system using this command below. In practice, make sure to use the correct paths for the key and location to send the key, as well as users and IP addresses.
You will be prompted for a password, and then your key will be successfully transferred. Now, on the Linux box, navigate to /home/user/ where id_rsa.pub is and use this command to create an SSH directory if one is not already there: mkdir -p .ssh. Now, the final step is to cat id_rsa.pub to the .ssh authorized_keys file, using the command below.
Now, you are able to use passwordless authentication between a windows and a linux system. If there are connectivity issues, make sure to double check firewall rules and allow SSH sessions that use port 22, TCP.