Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Here is my .ssh/config file:

Host test
    HostName myserver.net
    User test
    IdentityFile ~/.ssh/id_rsa

Host git
    HostName myserver.net
    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
git@myserver.net's password: _

Does anyone know what could be a possible difference

share|improve this question
1  
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 ? –  Shutupsquare 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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.