0

So I've successfully authenticated myself with my private key, but now I want to disable passwords all together, so I can only access it with my private key.

I edit /etc/ssh/ssh_config and I add the following:

PasswordAuthentication no
PermitRootLogin no
ChallengeResponseAuthentication no
UsePAM no

at the bottom of the file. I then restart SSH with:

sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist 
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

and I try to authenticate with a device that doesn't know my private key at all. I can log in fine just by logging in with my regular user (username@123.123.123.123).

How do I do this? I'm running El Capitan 10.11.1 on my machine.

1

You need to change your settings in /etc/ssh/sshd_config, not ssh_config. ssh_config is the global configuration file for the local ssh client software, whereas /etc/ssh/sshd_config is the configuration file for the sshd server.

2
  • I am pretty sure they changed that in a newer version of OS X, because that file does not exist, and when I change the ssh_config I wrote, I get errors when logging in, if I do something "wrong". Feb 22 '17 at 9:51
  • I am running Sierra and here is my /etc/ssh directory: tatooine-1220:~ mallert$ cd /etc/ssh tatooine-1220:ssh mallert$ ls ssh*_config ssh_config sshd_config Feb 23 '17 at 0:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .