Skip to content

Instantly share code, notes, and snippets.

@chiro-hiro
Last active January 23, 2026 04:12
Show Gist options
  • Select an option

  • Save chiro-hiro/937b0266195bbcaddf6497f2977d8073 to your computer and use it in GitHub Desktop.

Select an option

Save chiro-hiro/937b0266195bbcaddf6497f2977d8073 to your computer and use it in GitHub Desktop.
How to disable SSH password login on MacOS
sudo vim /etc/ssh/sshd_config.d/100-macos.conf

Add 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment