When I want to connect to my server like this
ssh -a [email protected] -p 22
it gives me two error messages:
PTY allocation request failed on channel 0 shell request failed on channel 0
When I use the parameter -T
the first error message goes away. But how to fix the second one? I can't connect. To other servers I can connect without any problems.
I'm on MAC OS 10.9.
The parameter -v
shows me this debug output:
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
After I enter the password, I get this:
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
In short, the ssh pty allocation request failed on channel 0 error happens when the server isn't assigning a TTY instance for the connection.
As described in the comments on the question, the “PTY allocation request failed” is a red herring with respect to GitHub authentication (it is the result of trying to interactively login to GitHub when the only SSH service they offer is non-interactive Git-over-SSH; the authentication is working, they just do not ...
So it responds also with "shell request failed on channel 0" when given an accepted command like "help" it works fine. There is a limit of 256 pseudo terminals on a system. Maybe you have an application that is leaking pseudo terminals. Use I was getting this error (without PTY allocation error).
As the first step, let’s check the details of the error “ pty allocation request failed on channel 0 “. It is one of the common errors that happen when we ssh into the server. The error mainly occurs when the SSH server isn’t assigning a TTY instance for the connection. In simple words, this affects the interactivity in the shell.
If you are getting "X11 forwarding request failed on channel 0" message upon SSH login, there could be several reasons. Solutions vary as well, as desribed below. For security reason, OpenSSH server, by default, binds X11 forwarding server to the local loopback address, and sets the hostname in DISPLAY environment variable to localhost.
Thus the shell request failed error. when the server is jenkins it only supports a limited command set, not a shell. So it responds also with "shell request failed on channel 0" when given an accepted command like "help" it works fine. There is a limit of 256 pseudo terminals on a system.
PTY allocation request failed on channel 0
There is a limit of 256 pseudo terminals on a system. Maybe you have an application that is leaking pseudo terminals. Use
lsof /dev/pts/*
to see what processes have open pseudo-terminals
shell request failed on channel 0
I was getting this error (without PTY allocation error). It turns out that one of my applications (QtCreator 3.0.?) was leaking Zombie processes. Other users were able to log in so I might have been hitting my per user process quota (if there is such a thing). I've updated to QtCreator 3.3. So far so good.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With