SSH from Windows to Linux without entering a password

I am trying to use ssh/scp from Windows to Linux without having to enter a password.

This is what I have done, and it doesn't seem to work:

  • generated public and private keys using Putty Key Generator (on Windows)
  • saved the files as id_rsa.pub and id_rsa
  • copied them into ~/.ssh
  • added id_rsa.pub to the Linux box in ~/.ssh/authorized_keys
  • I then try to ssh to the Linux box from Windows and I still have to enter a password

Am I missing something?


Solution 1:

You have to run an authentication agent on Windows.

For example, Pageant, used in combination with PuTTY (graphical SSH client) or Plink (its command line equivalent).

You'll need to tell Pageant your SSH server's public key. After that it will deal with your server's authentication requests while running in the background.

Solution 2:

You need Pageant.

See the video Password-less login with PuTTY and Pageant. And/or the blog post Howto: Passwordless SSH authentication with PuTTY.

Solution 3:

I used this:

c:\> type c:\users\my_name\.ssh\id_rsa.pub | ssh [email protected] "cat >> ~/.ssh/authorized_keys"

Solution 4:

Try Plink (part of PuTTY)

 plink -v [email protected] -pw yourpw "some linux command"