SSH login without password?

Hello,
how can I set up SSH login to my NAS without password? I had it set up correctly in hassbian, but when I do the same in haasion, it doesnt work.

I followed this tutorial:
http://linuxproblem.org/art_9.html

Thank you.

what NAS do you have? You may need to edit your /etc/ssh/sshd_config and restart ssh. That tutorial will get you working. What’s not working? Do you still have to enter the password or does it refuse login?

Hello,
I have an Asustor NAS. It still asks for password. In which folder on hass should I have id_rsa and id_rsa.pub in /root ?
How shouldI edit /etc/ssh/sshd_config?

Thank you.

the keys need to be in ~/.ssh. Then make sure you added the key to your authorized_keys file also in ~/.ssh. If it is not, run the third command again from the link you posted.

Make sure the following lines in /etc/ssh/sshd_config are set to this (should be defaults):

RSAAuthentication yes
PubkeyAuthentication yes

And if all else fails, restart the SSH service on the NAS.


On a separate more security minded note, to completely disable password login over SSH requires every device to have the key pair setup. If you disable password login your NAS will completely and unconditionally refuse all connections that do not have a key pair and won’t even let you enter a password. To do this edit the following lines in /etc/ssh/sshd_config to:

PasswordAuthentication no
ChallengeResponseAuthentication no
Use PAM no

Then restart the SSH service.

Make sure the rest of your config file is setup properly before doing this (defaults for everything else are usually ok). Also make sure you have another way of accessing and editing the sshd_config file in case you lock yourself out or something goes wrong with the configuration. Unfortunately I don’t know anything about the NAS you have, but most will allow you to start a telnet server or access some files from a web based GUI.

Hello,
so I can login to ma NAS withou password, but when I try to turn on this command line switch (via automation):
ssh root@NAS /etc/init.d/NASsuspend 2> /config/command.log
Ive got an error:
Host key verification failed.

Directly from terminal that command works fine.

What can be wrong?

Thank You again.

So I tried to make it work again, but I ended up with the same error:

Host key verification failed.

Any idea?

Thanks.