To disable this setting, you can do the following:

sudo vim  /etc/ssh/sshd_config

In this file, set the following settings to the following values. If these settings are already in the file, set them to "no" rather than add new lines.

PubkeyAuthentication yes
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Once this is done, restart the SSH daemon to apply the settings.

sudo systemctl restart sshd

or

/etc/init.d/ssh restart