首页 > 解决方案 > 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 没有任何想法,请问该怎么做?谢谢

标签: linuxsshraspberry-pi

解决方案


net.core.netdev_max_backlog不应该在/etc/ssh/sshd_config,而是在/etc/sysctl.conf


推荐阅读