I have changed some stuff within the sshd_config file and want to reset the file to its default settings. How would I go about doing this?


The ssh default config file is on /private/etc/ssh/sshd_config, you can copy it to .ssh directory by the following command

sudo cp /private/etc/ssh/sshd_config ~/.ssh/config

Then restart SSHD:

sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
  • Beware. There are 2 configuration files for ssh : /etc/ssh/ssh_config which is the configuration for the client SSH, and /etc/ssh/sshd_config which the configuration for the server SSH. – Rich Pauloo May 23 at 20:13

If it is for MAC i found this it may be useful


  • Thank you. You are a life saver. I have been looking everywhere, well almost everywhere, lol – StrangeRanger Sep 21 '17 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.