SSH with no password (passwordless) on Synology DSM 5 as other (non-root) user

I had the same problem. I run an instance of sshd in debug mode on the DiskStation using "/usr/syno/sbin/sshd -d", then I connect to it using "ssh user@DiskSation -vvv" and I got the debug info on the server:

......

debug1: temporarily_use_uid: 1026/100 (e=0/0)

debug1: trying public key file /var/services/homes/user/.ssh/authorized_keys

debug1: fd 5 clearing O_NONBLOCK

Authentication refused: bad ownership or modes for directory /volume1/homes/user

......

I realized that the home folder needs the right permissions too:

cd /var/services/homes/
chown <username> <username>
chmod 755 <username>

And replace with the actual username, like "user".

Finally, the problem is solved!


you need to chmod your home directory to 755 (synology has it at 777 by default)

nas> ls -al
total 28
drwxrwxrwx  6 root     root  4096 2014-07-13 03:00 .
drwxr-xr-x 13 root     root  4096 2014-07-13 03:00 ..
drwxrwxrwx  3 admin    users 4096 2014-07-13 03:00 admin
...
nas> chmod 755 /home/admin
nas> ls -al
total 28
drwxrwxrwx  6 root     root  4096 2014-07-13 03:00 .
drwxr-xr-x 13 root     root  4096 2014-07-13 03:00 ..
drwxr-xr-x  3 admin    users 4096 2014-07-13 03:00 admin

As your permissions for .ssh and authorized_keys are set correct, just verify that the permissions to your home directory (/home/aether/) are set correctly (chmod 755 /home/aether/).

I could not log in with the default permissions (711) and it worked after changing the permissions.

Cheers Stephan

Tags:

Linux

Ssh

Nas