Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 and id_rsa
  • copied them into ~/.ssh
  • added 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?

share|improve this question

migrated from Jan 15 '10 at 2:28

This question came from our site for professional and enthusiast programmers.

You need Pageant.

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

share|improve this answer
Please try to link to text-based tutorials instead of videos. – a coder Mar 30 '15 at 18:43
The blog link is broken. Try this one: – Kai Wang Dec 15 '15 at 14:14
The blog link broken is the exact reason answers should be more then a link. – Ramhound Jul 11 at 21:45

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.

share|improve this answer

Try Plink (part of PuTTY)

 plink -v -pw yourpw "some linux command"
share|improve this answer
+1 for a correct response, but you're better off using a public/private key pair than a password. – Ted Percival Jan 13 '10 at 17:09

Setting up SSH key authentication can be a bit tricky. It sounds like you're covering all your bases. One thing that often catches people off guard - you need to make sure the .ssh directory and its contents are owned by you and are read/writeably only by you.

Make sure to run this (on all your .ssh directories):

chmod -R 700 on ~/.ssh

If that doesn't work, turn on verbose logging by adding -v to your ssh command (you can add up to three -vss for more verbosity).

share|improve this answer

I'm assuming your keys are not password protected, and what you're getting is not a request for your key's password.

~/.ssh isn't used by putty on the windows side, and putty doesn't have a default private key setting. If you're using a command line ssh client such as cygwin, creating a .ssh directory off of your home would work. From putty, you'll need to configure and save a session.

From the putty configuration dialog, look at connection -> data, and fill in the auto-login username field. Then go to connection -> ssh -> auth, and set your private key correctly. Then go back to the session dialog, and save this session. You can also set the hostname if you'd like.

Once you have a saved session, you can use 'putty -load "savedsession"'.

share|improve this answer

You may also need to change permissions on your home directory:

chmod 755 ~
share|improve this answer

You must log in to answer this question.