sudo vim /etc/ssh/sshd_config.d/100-macos.confAdd this to file content:
UsePAM no
PasswordAuthentication no
ChallengeResponseAuthentication no
Save the file with :wq then restart sshd
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd