Tuesday, June 15, 2010

sshd[21670]: Authentication refused: bad ownership or modes for directory /home/malat

I was struggling to ssh without password (luckily ssh works when password is passed).

Looking at the log I got the info:

$ sudo tail -f auth.log
Jun 15 16:58:12 example sshd[21654]: pam_unix(sshd:session): session closed for user malat
Jun 15 16:58:16 example sudo: malat : TTY=pts/0 ; PWD=/home/malat/.ssh ; USER=root ; COMMAND=/sbin/ifconfig
Jun 15 16:59:10 example sshd[21670]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 16:59:10 example sshd[21670]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 16:59:14 example sshd[21673]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 16:59:14 example sshd[21673]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 17:01:03 example sshd[21686]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 17:01:03 example sshd[21686]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 17:01:40 example sshd[21691]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 17:01:40 example sshd[21691]: Authentication refused: bad ownership or modes for directory /home/malat
Jun 15 17:02:09 example sudo: malat : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail -f auth.log

This lead to:

* http://sial.org/howto/openssh/publickey-auth/problems

The solution was simply:

server$ chmod go-w ~/
server$ chmod 700 ~/.ssh
server$ chmod 600 ~/.ssh/authorized_keys

1 comment:

Unknown said...

thanks much. fyi, that sial link now belongs to a squatter. You might remove it.