2

After following the standard roadmaps to setup a github environment, I inmediatley encounter errors. I like to see these clarified. I have put a more detailed question below after the code garble that the terminal spits out.

the steps I followed to create a SSH key pair are as follows:

ssh-keygen -t rsa -C "[email protected]"

to test the connection

ssh [email protected]

the output from the test is:

PTY allocation request failed on channel 0

I don't know what it means but as I understand the -v flag will output debug information

 ssh -v [email protected]            
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [204.232.175.90] port 22.
debug1: Connection established.
debug1: identity file /Users/redres/.ssh/id_rsa type 1
debug1: identity file /Users/redres/.ssh/id_rsa-cert type -1
debug1: identity file /Users/redres/.ssh/id_dsa type -1
debug1: identity file /Users/redres/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1+github12
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github12 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
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: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/redres/.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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/redres/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([204.232.175.90]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Forced command: gerve Richnl a7:d7:de:d3:80:a9:9f:be:02:88:74:50:0c:1e:5e:bc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command: gerve Richnl a7:d7:de:d3:80:a9:9f:be:02:88:74:50:0c:1e:5e:bc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Sending environment.
debug1: Sending env LC_CTYPE = 
PTY allocation request failed on channel 0

that did not give me anything usefull, because I don't understand most of it but after googling I used the -vT flag with the following output

ssh -vT [email protected]
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [204.232.175.90] port 22.
debug1: Connection established.
debug1: identity file /Users/redres/.ssh/id_rsa type 1
debug1: identity file /Users/redres/.ssh/id_rsa-cert type -1
debug1: identity file /Users/redres/.ssh/id_dsa type -1
debug1: identity file /Users/redres/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1+github12
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github12 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
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: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/redres/.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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/redres/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([204.232.175.90]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Forced command: gerve Richnl a7:d7:de:d3:80:a9:9f:be:02:88:74:50:0c:1e:5e:bc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command: gerve Richnl a7:d7:de:d3:80:a9:9f:be:02:88:74:50:0c:1e:5e:bc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Sending environment.
debug1: Sending env LC_CTYPE = 
Hi Richnl! You've successfully authenticated, but GitHub does not provide shell access.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2384, received 2936 bytes, in 0.3 seconds
Bytes per second: sent 7295.9, received 8985.2
debug1: Exit status 1

as I can filter out of al the forums and git itself, you can ignore the "shell access error" because you don't need it anyway

What I would like to know, if this is the correct output Can someone explain to me what PYT is and the T flag because they sort of play a central role in this. The -T flag is also not used in the official documentation.

Please, I like to understand this and not just put in dumb keystrokes

thanks in adv

Other steps involved I got from following this tutorial

1 Answer 1

4

On Linux and similar systems, "PTYs" or pseudo-TTYs are special devices used to run interactive command-line programs; they're like virtual displays/screens, except text-only. Every new Xterm or iTerm or Konsole window you open has its own PTY. Programs write text to that PTY, and the terminal draws it on screen. For each interactive SSH connection, the server also uses a PTY.

However, Github's SSH servers do not provide any interactive services – they allow only pushing and fetching Git repositories, which does not need or try to allocate a PTY; it's just a plain stream of data. This means the server can have PTY allocation disabled for the git@ account.

When you run ssh [email protected], your SSH client thinks you're going to open an interactive connection, so it asks the server to allocate a PTY for it. Since the server does not allow PTY allocation, the error message is printed. The -T option is used to tell your ssh client to never ask for a PTY on the server.

But whether you use ssh [email protected] or ssh -T [email protected] is irrelevant, since you're not going to get an interactive shell anyway – the server is configured to just print out a greeting message and disconnect.

In other words, the only time ever you connect to Github manually is when you're testing the connection. The rest of the time, the connection will be made by your git tools, which never use a PTY, so both the error message and the -T option are irrelevant.

$ ssh [email protected]
PTY allocation request failed
Hi grawity! You've successfully authenticated, but GitHub does not provide shell access.
$
2
  • Thanks for the clear explanation. Very helpful. As for the only time you would use these commands. It is my understanding that you do need them to make a SSH key to pair up with your git repository? I will assume that, because It is in the git docu.
    – Richard
    May 25, 2013 at 12:59
  • 1
    @Richard: You need ssh-keygen to make the key, but ssh [email protected] is only for testing, it can be skipped entirely. May 25, 2013 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .