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

I want to enable automatic ssh login using the .ssh/config file for my git user.

Here is my .ssh/config file:

Host test
    User test
    IdentityFile ~/.ssh/id_rsa

Host git
    User git
    IdentityFile ~/.ssh/id_rsa

It works for my test user but not for my git user so my global SSH configuration is correct.

The configuration are exactly the same as far as I know. It used to work with git user but I'm unable what change has broken the automatic logon.

When I type:

ssh -v git

I get the following log:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
Offering RSA public key: /Users/mylocalusername/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password's password: _

Does anyone know what could be a possible difference

share|improve this question
Hows the ssh servers config setup, do you have Authorised keys in each home directory per user or do you have a global authorised keys file in sshd_config ? – squarebear Nov 10 '12 at 13:34
I have a global configuration, and each user has its own authorized_keys files. But this file is a duplicate. – Martin Delille Nov 10 '12 at 14:52
up vote 1 down vote accepted

Check the log on the server to see why it doesn't accept the user's key. You may need to change the log level in sshd_config to

LogLevel DEBUG

and restart sshd.

share|improve this answer
Which file does the log output? – Martin Delille Nov 10 '12 at 14:55
On Debian it's /var/log/auth.log, but the location varies between distributions. Check /etc/syslog.conf for the destination of auth messages. – Ansgar Wiechers Nov 11 '12 at 0:45
This is indeed /var/log/auth.log and I get the following: Nov 11 12:52:42 myserver sshd[18387]: Authentication refused: bad ownership or modes for directory /home/git – Martin Delille Nov 11 '12 at 11:57
I reset /home/git permission to 700 and it worked. – Martin Delille Nov 11 '12 at 12:00

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.