ssh - 如何修复 channel 0 上的请求失败

标签 ssh terminal pty

当我想像这样连接到我的服务器时

ssh -a username@my-server.de -p 22

它给了我两条错误消息:
PTY allocation request failed on channel 0
shell request failed on channel 0

当我使用参数 -T第一条错误消息消失了。
但是如何修复第二个呢?
我无法连接。我可以毫无问题地连接到其他服务器。

我使用的是 MAC OS 10.9。

参数-v向我展示了这个调试输出:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to xxx.your-server.de [188.40.3.15] port 22.
debug1: Connection established.
debug1: identity file /Users/xxx/.ssh/id_rsa type -1
debug1: identity file /Users/xxx/.ssh/id_rsa-cert type -1
debug1: identity file /Users/xxx/.ssh/id_dsa type -1
debug1: identity file /Users/xxx/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version mod_sftp/0.9.8
debug1: no match: mod_sftp/0.9.8
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 55:f5:ca:ca:01:45:0f:7b:71:0a:1f:ba:9e:25:17:fb
debug1: Host 'xxx.your-server.de' is known and matches the RSA host key.
debug1: Found key in /Users/xxx/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/xxx/.ssh/id_rsa
debug1: Trying private key: /Users/xxx/.ssh/id_dsa
debug1: Next authentication method: password

输入密码后,我得到这个:
debug1: Authentication succeeded (password).
Authenticated to xxx.your-server.de ([xxx.xxx.3.15]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = de_DE.UTF-8
shell request failed on channel 0

最佳答案

PTY allocation request failed on channel 0



系统上有 256 个伪终端的限制。也许您有一个正在泄漏伪终端的应用程序。使用
lsof /dev/pts/*

查看哪些进程打开了伪终端

shell request failed on channel 0



我收到此错误(没有 PTY 分配错误)。事实证明,我的一个应用程序(QtCreator 3.0.?)正在泄漏 Zombie 进程。其他用户能够登录,所以我可能已经达到了每个用户的进程配额(如果有的话)。我已经更新到 QtCreator 3.3。到目前为止一切顺利。

关于ssh - 如何修复 channel 0 上的请求失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27021641/

相关文章:

terminal - 我可以在 Unix 中运行 jshell 吗?

c - pty 终端数据包模式 TIOCPKT

unix - 为 sftp 帐户设置 umask?

ssh - 在 rundeck 中添加远程节点

ssl - 如何解密使用 Diffie Hellman 加密的 SSH .pcap 文件。使用公钥和私钥

macos - Bash 命令从远程 url 复制图像

terminal - 终端进程命令无法启动退出代码 :0 and exit code:2

shell - 从命令调整终端大小?

node.js - 运行Codebox时查找Node包的问题

ssh - 计算 ecdsa-sha2-nistp256 的交换哈希