我正在尝试通过 ssh 从 mac (osx 10.14.4) 连接到 linux 机器 (Ubuntu 18.04.2)。我不是 shh 专家,这是我第一次尝试使用它,但似乎发生的情况是连接正常但在同一时刻停止了。
这是 Mac 上详细 shh 的最后几行
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.1.100 ([192.168.1.100]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = it_IT.UTF-8
debug1: Sending env LC_TERMINAL_VERSION = 3.3.0beta12
debug1: Sending env LC_TERMINAL = iTerm2
packet_write_wait: Connection to 192.168.1.100 port 22: Broken pipe
这是 Linux 上的 ssh 服务的状态
giu 20 11:07:44 ezabba-Aspire systemd[1]: Stopped OpenBSD Secure Shell server.
giu 20 11:07:44 ezabba-Aspire systemd[1]: Starting OpenBSD Secure Shell server...
giu 20 11:07:44 ezabba-Aspire sshd[29577]: Server listening on 0.0.0.0 port 22.
giu 20 11:07:44 ezabba-Aspire sshd[29577]: Server listening on :: port 22.
giu 20 11:07:44 ezabba-Aspire systemd[1]: Started OpenBSD Secure Shell server.
giu 20 11:11:14 ezabba-Aspire sshd[29891]: Accepted publickey for ezabba from 192.168.1.99 port 49842 ssh2: RSA SHA256: <...>
giu 20 11:11:14 ezabba-Aspire sshd[29891]: pam_unix(sshd:session): session opened for user ezabba by (uid=0)
giu 20 11:11:14 ezabba-Aspire sshd[29891]: pam_unix(sshd:session): session closed for user ezabba
所以我很无知,但我可以看到Accepted publickey
和session opened for user
之后立即出现session closed for user
,但为什么呢?我不明白我做错了什么。
答案1
我遇到过类似的问题,并通过将此配置添加到 ssh 配置中解决了它。
Host *
IPQoS lowdelay throughput