37

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?

Evan Kroske
  • 2,018
  • 4
  • 21
  • 22

2 Answers2

47

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.

pa4080
  • 29,351
  • 10
  • 85
  • 161
LassePoulsen
  • 14,517
  • 8
  • 47
  • 59
26

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
A.B.
  • 89,123
  • 21
  • 245
  • 323
prule
  • 471
  • 4
  • 10