Hi, I was setting up my fresh installed Omv5 to have access only through SSH public key auth but no matter what I try it keeps give me authentication failing to connect.
What I did
- I created an user and gave him ssh permission (with password works great)
- created ssh keys with ssh-keygen and check that the public one was matching between the user and the /var/lib/openmediavault/ssh/authorized_keys
- disabled permit root login and password authentication
still what I get is wek@192.168.1.2: Permission denied (publickey).
So I went ahead and looked at the /var/log/auth.log to see what was going on:
Not really informative, so I went inside the server and check the permission for the authorized key and seems fine:
Finally I thought to check the /var/log/auth.log and found this:
Code
wek@omv:/var/lib/openmediavault/ssh/authorized_keys# tail /var/log/auth.log
Apr 19 11:50:35 omv sshd[3075]: Authentication refused: bad ownership or modes for directory /
Apr 19 11:50:35 omv sshd[3075]: Connection reset by authenticating user wek 192.168.1.8 port 52829 [preauth]
Apr 19 11:52:33 omv sshd[3268]: Authentication refused: bad ownership or modes for directory /
Apr 19 11:52:33 omv sshd[3268]: Connection reset by authenticating user wek 192.168.1.8 port 52843 [preauth]
Apr 19 11:53:09 omv sshd[3332]: Authentication refused: bad ownership or modes for directory /
Apr 19 11:53:09 omv sshd[3332]: Connection reset by authenticating user wek 192.168.1.8 port 52847 [preauth]
root@omv:~# ls -ld /
drwxrwxr-x 20 root root 4096 Apr 18 12:36 /
root@omv:~#
Alles anzeigen
Now first of all I didn't pay really attention ever to the / folder on other machines, but that directory permissions look a bit strange to me, or am I missing something?