Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to configure SSH Password less between Windows Server and Linux Server?

How to configure SSH Password less between Windows Server and Linux Server

user-image
Question added by Ayman Ali Sharara , System Administrator , IDEMIA Security & Identity - Abu Dhabi
Date Posted: 2017/11/10
Muhajed Ibrahim
by Muhajed Ibrahim , IT Manager,support,helpdesk,servicedesk,onsite , Pwc - Sweden,Studemaskolan

  1. Generate an SSH key pair on the Windows server using an SSH client such as PuTTYgen or OpenSSH. This will create a public key and a private key.

  2. Copy the public key to the Linux server. You can do this by using the SSH client to connect to the Linux server and manually adding the public key to the authorized_keys file in the user's home directory. You can also use a tool like ssh-copy-id to automate this step.

  3. Test the SSH connection to make sure the passwordless authentication is working. You should be able to connect from the Windows server to the Linux server without being prompted for a password.

 

  1. Generate an SSH key pair on the Windows server:
  • Open an SSH client such as PuTTYgen or OpenSSH on the Windows server.
  • Click the "Generate" button to create a new key pair.
  • Save the private key to a secure location on the Windows server.
  • Copy the public key to the clipboard.
  1. Copy the public key to the Linux server:
  • Use an SSH client such as PuTTY or OpenSSH to connect to the Linux server.
  • Create an authorized_keys file in the user's .ssh directory if it does not already exist: mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys
  • Paste the public key into the authorized_keys file: echo "ssh-rsa <public key>" >> ~/.ssh/authorized_keys
  • Set the correct permissions on the authorized_keys file: chmod ~/.ssh/authorized_keys
  1. Test the SSH connection:
  • Open an SSH client such as PuTTY or OpenSSH on the Windows server.
  • Enter the IP address or hostname of the Linux server and the username you configured for passwordless authentication.
  • Connect to the Linux server. You should be able to do so without being prompted for a password.
  • BE adviced not recomended from a security stand point 

higinio ongcoy
by higinio ongcoy , Senior Civil Engineer , ILF Consulting Engineers

not interested because out of scope to my job.

AbdelAziz Sharaf
by AbdelAziz Sharaf , Biology Teacher , El-Abasia Military Sec. School

- ssh from the host (server you want to start connection from) to the guest (server you wanna log in into)

> if both then do this twice with both servers)

 

- you may add the server to known hosts at first log in

> a prompt will ask you if you wanna do that.. just type yes

 

- other way is to assign a key pair verification or public and private key

you'll need a past log in

generate your key using `ssh-keygen` and assign it from host to guest using `ssh-copy-id`

be careful if you have multiple keys this may assign all keys to your server so either move them until you assign your wanted key or assign your private key directly into your guest .ssh/authorized_keys file as one line

Tawfiqur Rahman
by Tawfiqur Rahman , Founder And Owner , Suveccha Ltd

Step 1: Generate SSH Key Pair 

Step 2: Upload Public Key to Remote Server (either linux or windows).

 

"SSH Key Pair" is the way to SSH Password less login both for windows server & linux server 

Pramod Garwan
by Pramod Garwan , Software Developer , proglogix research and development pvt ltd

Step 1: Generate SSH Key Pair 

Step 2: Upload Public Key to Remote Server (either linux or windows).

MD MONIRUL HAQUE TALUKDER
by MD MONIRUL HAQUE TALUKDER , Administrator(System & Database) , IFIC Bank Ltd, and A leading commercial private Bank in Bangladesh

Linux is better then windows

Anwar  Ahmed
by Anwar Ahmed , Project Contract Manager , State Life Corporation of Pakistan

Dont really know as its a technical work.

Abdullah Alamre
by Abdullah Alamre , Director of the Office of the Director of Administrative Affairs at the Economic Corporation , Yemeni Economic Corporation

This section is aimed for Linux (and Mac) users that need no PuTTy to connect to a server / vps. Or, you may need this just in case if you want to allow login from one of your Linux VPS to another, e.g: to setup rsync to run automatically via cron job.

In this tutorial I use server 1 to connect it to  server 2 (remote server). Server 1 doesn’t have to be a server, it can also be a local computer running your favorite Linux Distro.

Step 1 – Login to server 1 as your favorite username. My server 1 is a playground vps hosted by Digital Ocean and in this example I loggin as root so all commands have no sudo prefix.

Step 2 – Now lets generate a pair of public keys using following command:

ssh-keygen -t rsa

Just hit Enter button on your keyboard several times till you see the key’s random art image.

Step 3 – Now login to server 2 (the remote server you want to password-less SSH login to) from inside server 1. You can login as a user or as root

Step 4 – Next, exit from server 2 and back to server 1. Type:

exit

That’s all. You can now try SSH-ing to server 2 (remote vps) from server 1 (local computer or another vps).

ssh

Nishad Ali C Chakkungal
by Nishad Ali C Chakkungal , Cloud Support Engineer , Hitachi Vantara

Generate RSA and PEM key combination and then use any Third Party SSH tools like Mobxterm, putty etc

Sheriff Olayinka Adedokun
by Sheriff Olayinka Adedokun , SEO Manager and Web Developer (Freelancer) , Digital Schools PTY Ltd

If it is about setting up SSH Passwordless login for windows to linux, then all we need to do is to generate a public auth key and append to remote host file. The procedure for this requires you to understand how to use command line and putty.

Though this is kind of long process but I will try as much as possible to summarize here.You need to check for existing SSH key before generating a new Pair. I would recommend generating the key via putty. While doing this, make sure you select SSH-2 RSA as it is more secure than SSH-1 and the rest. You can also increase the key value from to to make it more stronger to here.Youe done with this, you need to login to the server and enter the following

cmdmkdir -p .ssh

chmod .ssh

nano .ssh/authorized_keys

Copy the generated key in putty anf paste in the cmd screen

Save and exit and change permission to. Please don't forget to save the private and public key. Public key extension is .txt and Private key extension is .ppk

So you are going to use the public and private key to login instead of password

To set up a passwordless SSH login in Linux generate a public authentication key and append it to the remote hosts ~/.ssh/authorized_keys file

then any app in windows can use the public key to access linux

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.