How to ssh to remote server without password prompt on windows 10

How to ssh to remote server without password prompt on windows 10

Posted by Luke Beeno on January 28, 2022

How to ssh to remote server without password prompt on windows 10

How to ssh to remote server without password prompt on windows 10

Posted by Luke Beeno on January 28, 2022

ssh to remote server without password prompt on windows 10

If your using Jenkins, JFrog Pipelines or one of those automated servers in order to build, test and deploy your project from your local machine to a remote server. You might need to ssh in your remote server without have to enter a password or passphrase from a command shell. Maybe, your just annoyed with entering passwords all the time you have to connect to a remote server.

In this lesson, you will be shown how to remote to your server without being prompted for authentication. Windows 10 will be used to demonstrate this solution. However, you might be able to follow along if your on another OS. However, you just might need to change a few commands entered in the command prompt towards the end of the lesson.

Step 1. Download Cygwin

Go to the website https://www.cygwin.com/ and click on setup-x86_64.exe to download.

Step2. Launch the Cygin installer by double clicking on setup-x86_64.exe and go through the installation process 

You should see a display like below:

Click next

You should see a display like below after click next:

Click next to install from internet.

You should see a display like below.

Click next to place root directory in C Drive (C:)

You should see a display like below:

Click next

You will see the options on how to connect to the internet:

In this demo, Direct Connection will be chosen

In this next step you should see a list of available download sites select one:

If it could not download a list just go here https://www.cygwin.com/mirrors.html. Copy and paste one of the links to the User URL: input field, then click add. You can also click the back button and choose another option; another option might create the list.

Select the option you added or if you had success in getting the list, select one of the options from the list and click next. This option worked at the time of creating this tutorial https://cygwin.mirror.globo.tech/.

In this step you will be shown the packages to install:

You can choose from the list what to install or just click next.

The packages are being downloaded and installed in this step:


This step will show you that installation is complete:

Click finish

Step 3. Make Cygwin available throughout the system:

Type run in the windows search field, then type SystemPropertiesAdvanced in the run input field.

You should see a pop up box like below:

Click on the environment variables button

Another pop up box will appear:

Double click on the Path row in the System variables section

Another pop will appear for you to edit variable:

Click in an empty row and add C:\cygwin64\bin

Click ok on all the popups.

Open command prompt and type pwd:

If you see the details like below image, your good to go. 

Step 4. Create rsa key pair:

Enter ssh-keygen from the command prompt

Click enter on all the prompts and do not enter a passphrase.

You will see the result below

Step 5. Copy id_rsa.pub to remote server:

Enter command in prompt:

cat .ssh/id_rsa.pub | ssh root@123.45.67.89 "cat >> .ssh/authorized_keys"

or if you need to create  .ssh directory

cat .ssh/id_rsa.pub | ssh root@123.45.67.89  "mkdir ~/.ssh; cat >> .ssh/authorized_keys"

Step 6. Try to connect to server

Once you have copied the id_rsa.pub try to connect to remote server.

Enter in command prompt:

ssh root@123.45.67.89 

Related
No related post
Related
No related post