Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Pseudo TTY-Allocation? (SSH and Github)

People also ask

What is pseudo terminal allocation ssh?

When you run ssh without a command just to login, a pseudo tty is automatically allocated. But if you specify a command to execute on the ssh command line, by default, ssh does not allocate a pseudo tty. You need to force it to allocate one if you want to run commands such as top or screen.

What is pseudo tty in Linux?

A pseudo-TTY is a pair of character special files, a master file and a corresponding slave file. The master file is used by a networking application such as OMVS or rlogin. The corresponding slave file is used by the shell or the user's process to read and write terminal data.

How do I disable pseudo tty allocation?

Method 1: use ssh -T option to suppress this warning-t Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.


As explained in "gitolite: PTY allocation request failed on channel 0", it is important to do ssh test connection with -T, because some server could abort the transaction entirely if a text-terminal (tty) is requested.

-T avoids requesting said terminal, since GitHub has no intention of giving you an interactive secure shell, where you could type command.

GitHub only wants to reply to your ssh request, in order to ascertain that the ssh command does work (you have the right public/private keys, and the public one has been registered to your GitHub account)

PuTTy would be an example of a terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet and rlogin.
The name "PuTTY" has no definitive meaning, though "tty" is the name for a terminal in the Unix tradition, usually held to be short for Teletype.


Other use-cases for -T (beside testing)

  • Transferring binary files
  • Execute commands on a remote server
  • SSH tunneling: ssh -fnT -L port:server:port user@server (-f for background: you don't want to execute command, don't need a TTY and just want to establish a tunnel)