Restart SSH/sshd in Mac OS X

To restart ssh/sshd service in Mac OS X, you can simply run the following two commands together:

sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd

Your sshd will get restarted and your new ssh config file can be loaded as well.

p.s. Friendly reminding: DO NOT try to execute

sudo launchctl reboot com.openssh.sshd

instead since your computer will immediately get rebooted 🙂