EDIT
The issue as exposed here is solved (about files modes of the
.ssh
folder.But an other issue persists so I create a new question : > Unable to login with SSH-RSA key
I can no longer connect with ssh-rsa key for a specific user, but it still work for other users.
The git
user defined as follow :
# cat /etc/passwd | grep git
git:x:1002:1002:,,,:/var/git:/bin/bash
So you noticed that this is the git user thus its home is /var/git
, it's not in /home
.
Now, ssh always prompt me for password :
$ ssh git@srv
git@srv's password:
I checked logs :
# tail -n 1 /var/log/auth.log
[...] Authentication refused: bad ownership or modes for file /var/git/.ssh/authorized_keys
So authorized_keys
as some ownership or modes missconfiguration.
I don't understand because here is the conf for this file :
# ls -l /var/git/.ssh/ | grep auth
-rw-rw-r-- 1 git git 394 mai 22 17:39 authorized_keys
And here is (in case...) the parent .ssh
dir:
# ls -al /var/git/ | grep ssh
drwxrwxr-x 2 git git 4096 mai 22 17:39 .ssh
And the $HOME
directory :
# ls -l /var/ | grep git
drwxr-xr-x 7 git git 4096 mai 27 10:49 git
So owners are always git
, like owner groups. And files are readable so where could be the trick ?
.ssh
directory actually require group-write access and on all of its files as well?.ssh
directory must (at least should) be read/write-able by the owner only, no access to group/others.