I forgot to make a backup of /etc/ssh/sshd_config when last editing it. I now want to restore it to the default. Can someone upload the original text or show me how to obtain the original myself if there is a way should be right??
Thank you :)
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI forgot to make a backup of /etc/ssh/sshd_config when last editing it. I now want to restore it to the default. Can someone upload the original text or show me how to obtain the original myself if there is a way should be right??
Thank you :)
TLDR: Check /usr/share/openssh/sshd_config
.
Suggestion for the future: Look in to etckeeper
.
Other than purging and re-installing a package, there isn't a general way on Debian to reset the config to the default. There are basically three different ways packages handle config:
dpkg-deb -x
to extract this from the .deb
file (do not extract to /
! Instead extract it to a temporary directory, then copy it out). May archive managers can also extract from deb files for you./etc
(often /usr/share
), use ucf
to install it.ucf
. If you're lucky, the generated file is sitting somewhere, probably in /var/lib
.As a user, you can tell them apart by what the you've modified the config prompt you sometimes see at upgrade looks like. dpkg -S
will also only find files that are case #1 above.
Sometimes with (2) or (3), you'll get prompted again by using dpkg --reconfigure «package»
, especially if you pick different options than before. But not always; depends on the package. (Ideally it'd never happen, but some config files are too complicated to easily merge in your changes).
openssh-server does (2); you can find the original config at /usr/share/openssh/sshd_config