我目前无法通过 SSH 连接到我的远程工作站(不幸的是我没有管理员权限),而是shell request failed on channel 0
在尝试正常打开 SSH 连接并exec request failed on channel 0
尝试远程执行命令时收到错误消息。
但是,我仍然能够使用 Remmina 通过 RDP 访问远程系统(服务器已安装 xrdp)。此外,据我所知,这个问题只影响我 - 其他用户可以通过 RDP 和 SSH 访问工作站。
本地和远程系统均使用 Ubuntu(分别为 20.04.3 和 18.04.3)。问题最初出现时,由于另一个用户完全冻结了系统(试图同时运行一系列昂贵的计算),远程系统必须重新启动,但现在工作站的资源已再次释放,经过多次重新启动和注销/登录后,问题仍然存在。
由于我仍然可以通过 RDP 连接,因此我尝试journalctl
在每次 SSH 连接尝试后发现以下条目(乍一看堆栈跟踪似乎与我无关,但在尝试连接几次后,它似乎几乎总是出现在错误之后sshd
):
Nov 28 10:59:18 <hostname> sshd[80953]: error: do_exec_pty: fork: Resource temporarily unavailable
Nov 28 10:59:18 <hostname> gnome-shell[79418]: Object St.Bin (0x55a0c655e260), has been already finalized. Impossible to set any property to it.
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: == Stack trace for context 0x55a0c3a70340 ==
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #0 0x55a0c3e92910 i resource:///org/gnome/shell/ui/userWidget.js:59 (0x7fdda0655cd0 @ 212)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #1 0x7ffc5a863090 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #2 0x55a0c3e92890 i resource:///org/gnome/shell/ui/components/polkitAgent.js:342 (0x7fdd90068ab0 @ 59)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #3 0x7ffc5a8643f0 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #4 0x55a0c3e927d0 i self-hosted:916 (0x7fdde40f12b8 @ 367)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: == Stack trace for context 0x55a0c3a70340 ==
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #0 0x55a0c3e92910 i resource:///org/gnome/shell/ui/userWidget.js:60 (0x7fdda0655cd0 @ 274)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #1 0x7ffc5a863090 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #2 0x55a0c3e92890 i resource:///org/gnome/shell/ui/components/polkitAgent.js:342 (0x7fdd90068ab0 @ 59)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #3 0x7ffc5a8643f0 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #4 0x55a0c3e927d0 i self-hosted:916 (0x7fdde40f12b8 @ 367)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: == Stack trace for context 0x55a0c3a70340 ==
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #0 0x55a0c3e92910 i resource:///org/gnome/shell/ui/userWidget.js:65 (0x7fdda0655cd0 @ 365)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #1 0x7ffc5a863090 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #2 0x55a0c3e92890 i resource:///org/gnome/shell/ui/components/polkitAgent.js:342 (0x7fdd90068ab0 @ 59)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #3 0x7ffc5a8643f0 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #4 0x55a0c3e927d0 i self-hosted:916 (0x7fdde40f12b8 @ 367)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: == Stack trace for context 0x55a0c3a70340 ==
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #0 0x55a0c3e92890 i resource:///org/gnome/shell/ui/components/polkitAgent.js:343 (0x7fdd90068ab0 @ 84)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #1 0x7ffc5a8643f0 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7fdde40b5de0 @ 71)
Nov 28 10:59:18 <hostname> org.gnome.Shell.desktop[79418]: #2 0x55a0c3e927d0 i self-hosted:916 (0x7fdde40f12b8 @ 367)
Nov 28 10:59:18 <hostname> gnome-shell[79418]: Object St.Bin (0x55a0c655e260), has been already finalized. Impossible to set any property to it.
Nov 28 10:59:18 <hostname> gnome-shell[79418]: Object St.Bin (0x55a0c655e260), has been already deallocated - impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs
Nov 28 10:59:18 <hostname> gnome-shell[79418]: clutter_actor_set_size: assertion 'CLUTTER_IS_ACTOR (self)' failed
Nov 28 10:59:18 <hostname> gnome-shell[79418]: Object St.Bin (0x55a0c655e260), has been already deallocated - impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs
Nov 28 10:59:18 <hostname> gnome-shell[79418]: clutter_actor_show: assertion 'CLUTTER_IS_ACTOR (self)' failed
似乎fork: Resource temporarily unavailable
表明我的资源不足,所以我还尝试使用ulimit -a
和检查系统限制less /etc/security/limits.conf
。结果似乎有点矛盾,尤其nproc
是与 相比ulimit -u
:
ulimit -a
-----
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 514665
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 514665
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
/etc/security/limits.conf
-----
(entries for other users...)
<username> hard nproc 12
<username> hard as 67000000
<username> hard memlock 67000000
<username> hard rss 67000000
运行ps --no-headers auxwwwm | awk '$2 == "-" { print $1 }' | sort | uniq -c | sort -nr
告诉我,我的用户帐户中有 731 个正在运行的进程,并且运行lsof -u <username> 2> /dev/null | sed -E "s/^(..........).+$/\1/" | sort | uniq -c | sort -r | head
给我以下信息:
3740 evolution
801 gnome-she
636 goa-daemo
489 deja-dup-
338 baloo_fil
336 dbus-daem
275 gnome-sof
236 gvfs-udis
231 x-termina
216 gvfs-afc-
因此看起来我确实可能超出了打开文件或进程的限制,但这似乎是由于我一直在运行的程序没有任何问题。
让我更加困惑的是,我仍然可以通过 RDP 连接并照常使用工作站。有人知道为什么 SSH 不能工作而 RDP 可以工作吗?我该如何让它重新工作?