![如何在 Linux Redhat 中将 sshd 配置重置为默认值](https://linux22.com/image/684122/%E5%A6%82%E4%BD%95%E5%9C%A8%20Linux%20Redhat%20%E4%B8%AD%E5%B0%86%20sshd%20%E9%85%8D%E7%BD%AE%E9%87%8D%E7%BD%AE%E4%B8%BA%E9%BB%98%E8%AE%A4%E5%80%BC.png)
我需要 ssh 配置的第一个版本。位于/etc/ssh/sshd_config
。不幸的是,当前的 ssh 配置已被其他开发人员更改了几次,很难理解修改了什么。我想知道是否有任何方法可以重置默认的 ssh 配置,或者如果有人有 ssh 配置的内容,您是否可以分享它。
答案1
只需将文件移走/删除它并重新安装适当的包即可。
$ rpm -qf /etc/ssh/sshd_config # to find out what package owns the file
openssh-server
$ mv /etc/ssh/sshd_config{,.old} # backup the modified version
$ yum reinstall openssh-server # will create the file with default configuration