linux - ssh 不启动,错误的配置选项
问题描述
当我尝试启动 ssh 时systemctl start ssh
出现以下错误
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
我得到的结果systemctl status ssh.service
是
> ● ssh.service - OpenBSD Secure Shell server Loaded: loaded
> (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
> Active: failed (Result: exit-code) since Thu 2020-07-16 12:40:33 EEST;
> 1min 33s ago
> Docs: man:sshd(8)
> man:sshd_config(5) Process: 29636 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255/EXCEPTION)
>
> Jul 16 12:40:33 raspberrypi systemd[1]: ssh.service: Service
> RestartSec=100ms expired, scheduling restart. Jul 16 12:40:33
> raspberrypi systemd[1]: ssh.service: Scheduled restart job, restart
> counter is at 5. Jul 16 12:40:33 raspberrypi systemd[1]: Stopped
> OpenBSD Secure Shell server. Jul 16 12:40:33 raspberrypi systemd[1]:
> ssh.service: Start request repeated too quickly. Jul 16 12:40:33
> raspberrypi systemd[1]: ssh.service: Failed with result 'exit-code'.
> Jul 16 12:40:33 raspberrypi systemd[1]: Failed to start OpenBSD Secure
> Shell server.
我尝试了sshd -t
命令,结果如下
/etc/ssh/sshd_config: line 122: Bad configuration option: net.core.netdev_max_backlog
/etc/ssh/sshd_config: terminating, 1 bad configuration options
值是net.core.netdev_max_backlog = 3000
我尝试卸载 - 重新安装 ssh 没有任何想法,请问该怎么做?谢谢
解决方案
net.core.netdev_max_backlog
不应该在/etc/ssh/sshd_config
,而是在/etc/sysctl.conf
推荐阅读
- sql - 错误:用作表达式的子查询返回多行 - POSTGRES
- python - PyQt5 - 多处理时重复的 GUI
- html - 如何使用@media 在我的网站顶部放置不同的横幅?
- java - 移动 iOS 中的 rsaEncryptionOAEPSHA1 和 rsaEncryptionOAEPSHA256 是否支持 MGF1 参数?
- python - 我的 setup.py 在 python 3.8.1 中安装所有依赖项有什么问题
- azure-powershell - 无法通过 Azure Powershell RunBook 将 Rest API 输出导出到 CSV
- ios - SwiftUI 将数据从 Firebase 加载到 TextView
- environment-variables - RHEL - 环境变量
- c# - 导入后错误操作 C# JSON 数据
- android - 将图像从图库上传到 Firebase 存储时应用程序崩溃