7

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?

2 Answers2

17

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
steeldriver
  • 136,215
  • 21
  • 243
  • 336
5

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.

Ray
  • 2,071