-2

I am quite new to server administration and I am not doing it very often. Today I wanted to secure my server, especially the ssh server. Is it possible to configure ssh so that only users can login if an public exists in the autorized_keys file? In other words: Disable login with password, only allow login if the public key exists. I searched the web for quite a while but could not find anything pointing me the direction.

Thanks in Ahead.

philipp
  • 137
  • 2
  • 10

1 Answers1

3

In order to disable authentication using password, you have to disable the following settings in the configuration file of your sshd server (generally /etc/ssh/sshd_config):

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Then reload the configuration:

$ sudo service ssh reload
uloBasEI
  • 676
  • 1
  • 4
  • 11