alexander_ro hat geschrieben: ![↑ zum Beitrag ↑](https://debianforum.de/forum/styles/debianforumde/theme/images/debianforum_uparrow.png)
18.02.2021 11:16:26
Das mit dem TCPKeepAlive glaube ich nicht das es was bringt.
OK, aber auch wenn es was bringt, ist es als Dauerlösung nicht geeignet.
Versuch mal auch mit:
Code: Alles auswählen
net.ipv4.ip_nonlocal_bind = 1
net.ipv6.ip_nonlocal_bind = 1
in der /etc/sysctl.conf (oder gleichwertig).
Ich hatte mit dem sshd unter systemd auch Probleme, wenn der sshd nicht an allen Interfaces (d. h. nicht an lo) gelauscht hat. "ip_nonlocal_bind=1" hat geholfen.
EDIT:
Bei meinem sshd (... mit systemd, "ip_nonlocal_bind=1" und "ConfigureWithoutCarrier=true"für das Interface eth0) hat das Unterbrechen der LAN-Verbindung keinen Einfluss darauf, ob der sshd gestoppt wird oder nicht gestoppt wird. Z. B.:
Code: Alles auswählen
:~# dmesg -T | tail -n 6
[Fri Feb 12 05:24:25 2021] bcmgenet fd580000.ethernet eth0: Link is Down
[Fri Feb 12 05:24:39 2021] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[Fri Feb 12 05:24:44 2021] bcmgenet fd580000.ethernet eth0: Link is Down
[Fri Feb 12 05:24:50 2021] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[Fri Feb 12 05:25:35 2021] bcmgenet fd580000.ethernet eth0: Link is Down
[Fri Feb 12 05:25:42 2021] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Code: Alles auswählen
:~# netstat -tlpen | grep -i ssh
tcp 0 0 192.168.178.33:22 0.0.0.0:* LISTEN 0 16694 526/sshd
Code: Alles auswählen
:~# systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-02-10 08:54:48 CET; 1 weeks 1 days ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 526 (sshd)
Tasks: 4 (limit: 4915)
CPU: 37.507s
CGroup: /system.slice/ssh.service
├─ 526 /usr/sbin/sshd -D -4 -q
[/spoiler]