ssh无法启动,配置选项错误

时间:2020-07-16 09:47:16

标签: linux ssh raspberry-pi

当我尝试启动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没有任何反应 有什么想法怎么办?谢谢

1 个答案:

答案 0 :(得分:1)

net.core.netdev_max_backlog不应位于/etc/ssh/sshd_config中,而应位于/etc/sysctl.conf