Disable password authentication on SSH server on OS X Server 10.8

As any BSD system you should toggle off some options in your sshd_config like I've described in this Stack Overflow answer:

UsePam yes # it will not be used
ChallengeResponseAuthentication no
PasswordAuthentication no
kbdInteractiveAuthentication no

In case it helps, I was having trouble with this on 10.10 (Yosemite) and it turned out I was editing the wrong file. /etc/sshd_config is the right one, not /etc/ssh/sshd_config, which is what I was trying based on what man sshd_config says:

SSHD_CONFIG(5)              BSD File Formats Manual             SSHD_CONFIG(5)

NAME
     sshd_config -- OpenSSH SSH daemon configuration file

SYNOPSIS
     /etc/ssh/sshd_config

DESCRIPTION
     sshd(8) reads configuration data from /etc/ssh/sshd_config ...