Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my first time with Git and I'm trying to set it up on my box. I added my key to my profile in the Github web interface. When I try to connect... :

max@linux-vwzy:~> ssh
The authenticity of host ' (' can't be established.
RSA key fingerprint is xx
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ',' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0

max@linux-vwzy:~> ssh-add ~/.ssh/id_rsa
Identity added: /home/max/.ssh/id_rsa (/home/max/.ssh/id_rsa)

max@linux-vwzy:~> ssh
PTY allocation request failed on channel 0

I'm supposed to be getting some kind of welcome message however, I'm not.

share|improve this question
It might be a problem on their end - a PTY allocation failure is a pretty low level error. – new123456 Jun 23 '11 at 3:05
up vote 8 down vote accepted

When you run ssh in a normal terminal environment, your SSH client (the ssh process on your local machine) will request a psuedo-terminal (pty) from the server.

GitHub has always denied pty allocation.

Older versions (prior to 5.6) of OpenSSH’s ssh will “fall back” to no-pty mode if the server rejected its pty allocation request.

Newer versions (5.6 through 5.8) of OpenSSH’s ssh abort if the server rejects its pty allocation request.

The latest versions (5.9 and later) of OpenSSH’s ssh will take the former action (continue) if the pty allocation was done automatically, and the latter action (abort) if there was an explicit request for a pty (-t given or RequestTTY equal to yes/force).

You can tell ssh (either old or new) to avoid requesting a pty allocation by using the -T option:

ssh -T

You should then see the GitHub message:

Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.

From the OpenSSH 5.6 release announcement:

  • Kill channel when pty allocation requests fail. Fixed stuck client if the server refuses pty allocation (bz#1698)

bz#1698 seems to be a reference to a report logged in the “Portable OpenSSH” Bugzilla.

From the check-in message of OpenSSH clientloop.c rev 1.234:

improve our behaviour when TTY allocation fails: if we are in RequestTTY=auto mode (the default), then do not treat at TTY allocation error as fatal but rather just restore the local TTY to cooked mode and continue. This is more graceful on devices that never allocate TTYs.

If RequestTTY is set to "yes" or "force", then failure to allocate a TTY is fatal.

share|improve this answer
hit it right on the head. thanks mate – n0pe Jun 23 '11 at 4:26

You must log in to answer this question.

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