使用 scp / rsync 后,Manjaro / Arch Linux 中的 ssh 会话无响应

使用 scp / rsync 后,Manjaro / Arch Linux 中的 ssh 会话无响应

我在笔记本电脑上全新安装了 Manjaro 20.2。现在我尝试通过 scp / rsync 在本地网络中的这台笔记本电脑和另一台笔记本电脑(kubuntu 18.04)和外部服务器(我相信是 Ubuntu 20.04)之间传输文件。

在这两种情况下,我的 Manjaro 笔记本电脑上的 rsync 初始调用都会传输一些文件,然后暂停并最终中止:

laptop% rsync -rtvvvuL --progress user@webserver:/directory/ /home/user/directory/
[snip]
Timeout, server webserver not responding.
rsync: connection unexpectedly closed (112760 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [receiver=v3.2.3]
[receiver] _exit_cleanup(code=12, file=io.c, line=228): about to call exit(12)
rsync: connection unexpectedly closed (100412 bytes received so far) [generator]
rsync error: unexplained error (code 255) at io.c(228) [generator=v3.2.3]
[generator] _exit_cleanup(code=12, file=io.c, line=228): about to call exit(255)
rsync: [generator] write error: Broken pipe (32)

如果在我的 kubuntu 笔记本电脑上调用 rsync 来与 Manjaro 同步文件,也会发生这种情况,因此 Manjaro 机器是服务器还是客户端并不重要。

如果之后,我再次尝试通过 SSH 连接到网络服务器,我会成功通过身份验证,但不会收到命令提示符:

laptop% ssh -vvv user@webserver                                                                           
OpenSSH_8.4p1, OpenSSL 1.1.1i  8 Dec 2020
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/user/.ssh/known_hosts2'
debug2: resolving "webserver" port 22
debug2: ssh_connect_direct
debug1: Connecting to webserver [123.456.789.111] port 22.
debug1: Connection established.
[snip]
debug1: Local version string SSH-2.0-OpenSSH_8.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
[snip]
debug1: Authentication succeeded (publickey).
Authenticated to webserver ([123.456.789.111]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug3: receive packet: type 4
debug1: Remote: /home/user/.ssh/authorized_keys:4: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 4
debug1: Remote: /home/user/.ssh/authorized_keys:4: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x48
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: send packet: type 80
debug3: send packet: type 80
debug3: send packet: type 80
debug3: send packet: type 80
debug3: send packet: type 80
debug3: send packet: type 80
Timeout, server p000327627.pwhost.de not responding.

另外,如果我再次调用 rsync,它不会执行任何操作:

laptop% rsync -rtvvvuL --progress user@webserver:/directory/ /home/user/directory/
opening connection using: ssh -l user webserver rsync --server --sender -vvvuLtre.iLsfxCIvu . /directory/  (10 args)
Confirm user presence for key ECDSA-SK SHA256:[snip]
Timeout, server webserver not responding.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=v3.2.3]
[Receiver] _exit_cleanup(code=12, file=io.c, line=228): about to call exit(12)

在我的 kubuntu 机器上,我可以毫无问题地与服务器进行 ssh/scp/rsync。另外,从我的 Android 到我的 kubuntu 机器的连接没有问题,但使用 Manjaro 时它会挂起。我在三个不同的wifi下观察到这个问题,这让我认为这与网络无关。

ssh/sshd 配置(或 Manjaro 机器上的任何配置)无关紧要,因为我可以使用 Manjaro 20.2 KDE Live System 重现该问题。

答案1

我找到了解决方案。 SSH 问题的原因是我的 WiFi 芯片组的驱动程序。我正在使用 Broadcom BCM4311 并安装 Broadcom-wl 驱动程序解决了我的问题。我首先安装了所有已安装内核的 linux 标头包,然后安装了 Broadcom-wl-dkms 驱动程序。

sudo pacman -Syyu
sudo pacman -S $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-headers"}' ORS=' ')
sudo pacman -S broadcom-wl-dkms

重新启动后,应启用“wl”驱动程序,我可以使用以下命令确认这一点:

laptop% inxi -Fxz | grep BCM4331
           Device-2: Broadcom BCM4331 802.11a/b/g/n vendor: Apple AirPort Extreme driver: wl v: kernel port: efa0 

司机应该wl不是 bcma-pci-bridge

以下网站向我指出了解决方案:

https://wiki.archlinux.org/index.php/Broadcom_wireless#SSH_freeze_for_BCM4331_with_b43

https://archived.forum.manjaro.org/t/broadcom-wifi-driver-fails-to-install-properly/46316/2

答案2

我在 2013 年 MacBook Pro Retina 显示屏(manjaro i3 版)上遇到了 ssh 挂起的非常类似的问题。我按照你提到的命令进行操作:

sudo pacman -Syyu
sudo pacman -S $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-headers"}' ORS=' ')
sudo pacman -S broadcom-wl-dkms

我的无线网络停止工作了。运行sudo pacman -S broadcom-wl修复了我用之前的命令破坏的wifi。

对我有用的是在使用sudo pacman -Syyu.

相关内容