ssh:登录成功后管道立即断开

ssh:登录成功后管道立即断开

我有两台服务器(至少在某一时刻)完全相同,运行良好。Ubuntu 18.04 Server pl2poland 是 pl3poland 的备份服务器,托管复制 PostgreSQL 数据库。我们使用管理员用户“invadm”通过 SSH 登录两台服务器。

由于某种原因,当您尝试以 invadm 用户身份登录时,pl2poland 服务器突然开始向我们提供管道损坏消息。

当我尝试从其他服务器通过 SSH 连接到 pl2poland 时出现此消息:

$ ssh invadm@pl2poland
invadm@pl2poland's password:
Write failed: Broken pipe

我确实有其他可以在 pl2poland 上使用的登录名,但如果我尝试从 pl2poland 上的任何用户(甚至是 root)通过 ssh 连接到 invadm 用户,我会收到这个略有不同的错误:

root@pl2poland: ssh invadm@pl2poland
invadm@pl2poland's password:
packet_write_wait: Connection to 192.168.23.5 port 22: Broken pipe

我相信该特定用户一定存在问题,但我尝试了各种方法,但无法找到解决方法。我在这里看到的其他问题都表明可能发生了超时,并建议调整 /etc/ssh/ssh_config 中的设置。但这种情况是立即发生的,而不是在几分钟的空闲时间之后。

这是我输入密码时 ssh -vv 消息中发生的情况。这是一个有效密码(已确认),ssh 甚至显示“身份验证成功”,但随后将我们踢出。

debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /.ssh/id_dsa
debug1: Trying private key: /.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
invadm@pl2poland's password:
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to pl2poland ([192.168.23.5]:22).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
Write failed: Broken pipe

我尝试更改密码,检查 /home/invadm 和 /home/invadm/.ssh 的权限,尝试使用“ssh -o IPQoS=throughput”的建议。似乎没有任何效果。

有人可以指出我应该检查的文件或阅读的文章吗?我可能还没有发现?

谢谢,

史蒂夫·N。

答案1

错误可能是用户没有分配登录 shell。请检查/etc/passwd,如果用户有 shell“false”或“nologin”,则登录后无法创建 shell。

相关内容