I'm setting up a server for backing up my desktop box remotely. I want to prevent remote password access to the server, permitting only users with private keys (AKA my desktop box) to access it. How can I block remote password access while allowing physical password access to the server?

up vote 37 down vote accepted

Just insert the following to the sshd config on the server (/etc/ssh/sshd_config)

PasswordAuthentication no

You might need to reload the ssh service

sudo service ssh reload

That should do the trick ;)

For more options type man sshd_config in to your terminal.

Just a note about SSH access to servers - you may also want to disable the root user from ssh, this way at least hackers will have to guess the username as well.

PermitRootLogin no
  • Or just lock and delete the password for the root account. (Assuming the default user has sudo access) – David Bailey Oct 6 '15 at 17:57

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.