On TOS, make sure you have in:
/etc/ssh/
I can't say sshd
and then ending with _config
But you need to edit that file. Otherwise i get banned from posting here apprantly.
This line:
#PubkeyAuthentication yes
Either commented out, or set to yes.
Restart ssh, do note that your current session will be disconnected!
systemctl restart ssh
Get the logs so you know what's going wrong when you use key login and fail
tail -f /var/log/auth.log
=== HOST ===
Before i continue with what went wrong, let's copy the public key over!
The easiest way is to use ssh-copy-id, but ofcours nobody is stopping you to make the ~/.ssh/authorized_keys with the entry yourself!
ssh-copy-id -i ~/.ssh/mypublickeyfortos.pub [email protected]
fill in your pass, and give the suggested ssh command a try.
You probably got prompted for a password? Check the logs on your nas you've open'd. Did you also get?
Authentication refused: bad ownership or modes for directory /home/username ?
To make it easy, this is how you need to have each dir (i didn't had issues for /home/, so i'll skip that) interms of permissions set:
=== TOS ===
chmod 0750 /home/username/
chmod 0750 /home/username/.ssh
chmod 0600 /home/username/.ssh/authorized_keys
Ofcours all owned by your user, but that should already be inplace.
Now give it one more try, now you'll see you can login with your username!
I'm not sure why the permissions are sometimes so screwed up, my ~/.ansible and ~/.config are 777 which is also odd. For an admin user the permission are more open then they should be, also for the more critical/sensitive admin account homedir itself.
I hope this atleast helped someone with configuring
