Solve the problem with SSH RSA-key login to Synology NAS

Below steps was help to fix for ssh rsa-key login with user admin (in my case it work well even with StrictModes in sshd conf). The reason is that the users home folder ~/ is not allowed to be writable to group and other, so let’s try to “chmod 755 /volume1/homes/user: should do the trick.

Step 1. Check if your pubkey is ok: it’s strange but sometimes during copy/paste something happens and it’s not working:

ssh-keygen -l -f /var/services/homes/admin/.ssh/authorized_keys

Step 2.

chmod 755 /var/services/homes/admin

Step 3.

chown admin:users /var/services/homes/admin/.ssh
chmod 700 /var/services/homes/admin/.ssh

Step 4.

chown admin:users /var/services/homes/admin/.ssh/authorized_keys
chmod 644 /var/services/homes/admin/.ssh/authorized_keys

Source: https://forum.synology.com/enu/viewtopic.php?f=90&t=116726&p=441504

RELATED POSTS
Share the Post: