Zut, dans /etc/ssh/sshd_config j’ai rajouté ça :
ClientAliveInterval 60
TCPKeepAlive yes
ClientAliveCountMax 10000
Et ça provoque une erreur :
# vim /etc/ssh/sshd_config
# service ssh restart
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
root@machine:~# 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 Fri 2021-01-29 18:25:43 CET; 27s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 177282 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255/EXCEPTION)
Tasks: 5 (limit: 38213)
Memory: 16.9M
CGroup: /system.slice/ssh.service
├─176690 sshd: root [priv]
├─176691 sshd: root [net]
├─176692 sshd: [accepted]
├─176773 sshd: root [priv]
└─176774 sshd: root [net]
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: Stopped OpenBSD Secure Shell server.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Start request repeated too quickly.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Failed with result 'exit-code'.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: Failed to start OpenBSD Secure Shell server.
root@machine:# journalctl -xe
-- The unit ssh.service has entered the 'failed' state with result 'exit-code'.
#AllowTcpForwarding yes
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: A start job for unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit ssh.service has finished with a failure.
--
-- The job identifier is 3808 and the job result is failed.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit ssh.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: Stopped OpenBSD Secure Shell server.
-- Subject: A stop job for unit ssh.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit ssh.service has finished.
--
-- The job identifier is 3899 and the job result is done.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Start request repeated too quickly.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: ssh.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit ssh.service has entered the 'failed' state with result 'exit-code'.
Jan 29 18:25:43 hostname.domaine.fr systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: A start job for unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit ssh.service has finished with a failure.
--
-- The job identifier is 3899 and the job result is failed.
Jan 29 18:25:53 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:01 hostname.domaine.fr CRON[177284]: pam_unix(cron:session): session opened for user admin by (uid=0)
Jan 29 18:26:01 hostname.domaine.fr CRON[177285]: (admin) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
Jan 29 18:26:01 hostname.domaine.fr sudo[177286]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 29 18:26:01 hostname.domaine.fr sudo[177286]: pam_unix(sudo:session): session closed for user root
Jan 29 18:26:01 hostname.domaine.fr CRON[177284]: pam_unix(cron:session): session closed for user admin
Jan 29 18:26:06 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:06 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:20 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:20 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:24 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jan 29 18:26:31 hostname.domaine.fr systemd-resolved[428]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
//EDIT : les valeurs existent déjà dans le fichier, mais sont commentées.
Donc pas d’erreur de syntaxe. Pourquoi cette erreur alors ?