[Feedback on issues] openssh登录访问,一段时间不操作后,总是会被强制中断
Tofloor
poster avatar
Zyx丶心
deepin
2025-11-17 01:11
Author
$ uname -a
Linux localhost 6.12.33-amd64-desktop-rolling #25.01.01.01 SMP PREEMPT_DYNAMIC Thu Jun 12 14:20:38 CST 2025 x86_64 GNU/Linux
$ cat /etc/os-release 
PRETTY_NAME="Deepin 25"
NAME="Deepin"
VERSION_CODENAME=crimson
ID=deepin
HOME_URL="https://www.deepin.org/"
BUG_REPORT_URL="https://bbs.deepin.org"
VERSION_ID="25"
VERSION="25"
$ dpkg -l | grep openssh
ii  openssh-client                                    1:9.9p2-0deepin1                         amd64        secure shell (SSH) client, for secure access to remote machines
ii  openssh-server                                    1:9.9p2-0deepin1                         amd64        secure shell (SSH) server, for secure access from remote machines
ii  openssh-sftp-server                               1:9.9p2-0deepin1                         amd64        secure shell (SSH) sftp server module, for SFTP access from remote machines
$ egrep -v "^\s*#|^\s*$" /etc/ssh/ssh_config
Include /etc/ssh/ssh_config.d/*.conf
Host *
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    ServerAliveInterval 30
    ServerAliveCountMax 3
$ egrep -v "^\s*#|^\s*$" /etc/ssh/sshd_config
Include /etc/ssh/sshd_config.d/*.conf
KbdInteractiveAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
ChannelTimeout session:shell=900 session:subsystem*=900
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server

登录ssh一段时间后,会自动强制退出,在ssh_config配置了保活配置都不行。

$ ssh 192.168.123.13
Linux localhost 6.12.33-amd64-desktop-rolling #25.01.01.01 SMP PREEMPT_DYNAMIC Thu Jun 12 14:20:38 CST 2025 x86_64
Welcome to deepin 25 GNU/Linux

    * Homepage: https://www.deepin.org/

    * Bugreport: https://bbs.deepin.org/


Last login: Mon Nov 17 00:06:10 2025 from 192.168.123.11
(base) user@localhost:~$ TMOUT=0
(base) user@localhost:~$ Connection to 192.168.123.13 closed.

请问各位大佬,怎么解决?

Reply Favorite View the author
All Replies
大多时候吃素
deepin
2025-11-17 07:05
#1

环境变量有没有TIMEOUT

Reply View the author
剑客初心
deepin
2025-11-17 08:46
#2

~/下和/etc/下grep TIMEOUT,看看有没有环境变量

Reply View the author
Zyx丶心
deepin
2025-11-17 10:13
#3
大多时候吃素

环境变量有没有TIMEOUT

已经执行过 TMOUT 变量,并将变量值设置为0(无限制),没有任何改善;TIMEOUT变量没有值。

甚至在容器中执行top,也会被强制中断,得到提示:

Timeout, server 192.168.123.13 not responding.

Reply View the author
Zyx丶心
deepin
2025-11-17 10:15
#4
剑客初心

~/下和/etc/下grep TIMEOUT,看看有没有环境变量

已经执行过 TMOUT 变量,并将变量值设置为0(无限制),没有任何改善;TIMEOUT变量没有值。

甚至在容器中执行top,也会被强制中断,得到提示:

Timeout, server 192.168.123.13 not responding.

不一定是bug,但更感觉像是某个不知在哪配置或强制特性,使得超时后就自动强制中止了。

Reply View the author