Usually people try to disable ssh login with password only. I'm asking about reverse situation. Does sshd_config allow to disable authentication with keys only?

  • The next thing you should look for is Google.
    – ceejayoz
    Sep 2, 2014 at 21:17
  • 2
    -1 because plain and simple, there is no good reason to do this.
    – EEAA
    Sep 3, 2014 at 1:23

2 Answers 2



         Specifies whether public key authentication is allowed.  The
         default is ``yes''.  Note that this option applies to protocol
         version 2 only.

As of today, one more option you may use AuthenticationMethods, please refer https://www.freebsd.org/cgi/man.cgi?sshd_config(5)

Please read doc carefully before apply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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