Server Fault is a question and answer site for system and network administrators. 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

This is the dumbest thing because I have done this a load of times before and never had issue so I am sure I am just doing something daft but I can't for the life of me figure it out.

I am trying to connect from a Windows 7 machine to a Linux box using key based authentication.

Here are the steps I have followed;

  1. Ran ssh-keygen -t rsa from Git Bash.
  2. Selected the default area for the file to be stored.
  3. Did not pick a password (left it blank)
  4. Copied the contents of onto the remote server (/home/user/.ssh/authorized_keys)

When I try and log in using ssh user@ip.ip.ip.ip -v I can see that it tries to match up my keys from the correct location on the Windows box, but it does not accept them and ends up falling back to passwords as the authenitcation method.

I have checked the permissions of authorized_keys - it is set to rw for the owner only.

Any help would be greatly appreciated.

share|improve this question
What about the permissions for the .ssh folder? it should be 700. Also, I've always use pageant for automagic authentication on PuTTY. – gparent Mar 28 '12 at 14:39
Gah the .ssh folder! Thank you so much, I hadn't even thought about it. This worked. Please add this as an answer and I will accept. – Toby Mar 28 '12 at 14:41
Answer completed. – gparent Mar 28 '12 at 14:42
up vote 3 down vote accepted

In addition to the permissions on authorized_keys, it is important to also set the permissions on the .ssh folder containing it:

gp@platinum:~/.ssh$ ls -la
total 24
drwx------ 2 gp gp 4096 Aug 17  2011 ./
-rw------- 1 gp gp 3703 Oct 25 10:52 authorized_keys

As you can see, the permissions for ~/.ssh should be 700, and the ones for ~/.ssh/authorized_keys should be 600.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.