M BUZZ CRAZE NEWS
// news

Default sshd_config file for Ubunu 20.04

By Emma Johnson

I've accidentally changed something in the /etc/ssh/sshd_config file and now sshd does not start.

I know I should have had a backup before editing it but it is too late now.

Can someone please show me the default content of the sshd_config file?

Or is there anywhere I can get it?

3

2 Answers

There should be a copy of the default config file at

/usr/share/openssh/sshd_config

(in fact, that's where the original /etc/ssh/sshd_config file gets copied from, by the openssh-server package's postinstall script). You can copy that, or use diff to review what you changed:

$ diff /usr/share/openssh/sshd_config /etc/ssh/sshd_config
122a123,125
>
> #Match Address *,!192.168.1.0/24
> # ForceCommand internal-sftp

You can re-download the package from here for Ubuntu 20.04.

Once you have the deb file, you can create a temporary directory and type dpkg-deb --extract <deb file> to extract it. And then look inside for the configuration file.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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