openssh PTY allocation

Morty Abzug morty at
Sun Jul 24 13:16:59 EST 2011

On Sun, Jul 24, 2011 at 11:24:45AM +1000, Darren Tucker wrote:

> Damien already added a config option ("RequestTTY") but there hasn't
> been a release since then (this problem didn't become apparent until
> after the 5.8 release when people used it with the problem devices).
>      RequestTTY
>              Specifies whether to request a pseudo-tty for the session.  The
>              argument may be one of: ``no'' (never request a TTY), ``yes''
>              (always request a TTY when standard input is a TTY), ``force''
>              (always request a TTY) or ``auto'' (request a TTY when opening a
>              login session).  This option mirrors the -t and -T flags for
>              ssh(1).

That sounds great.  It is indeed one of the two features I asked for.
But I think we still need a second option, in the event that a TTY/PTY
is requested and fails, to decide what should happen.  Something like
ExitOnTTYFailure yes|no|no-warn.  That way, sites where a TTY/PTY
error is normal for many devices and not catastrophic for other
devices don't need to configure RequestTTY for each device.  Instead,
we can just do a:

  Host *
  ExitOnTTYFailure no-warn
  RequestTTY auto

The above corresponds to the behavior for openssh and's ssh1
for many years.

Similarly, sites where a TTY/PTY error is always a problem can just

  Host *
  ExitOnTTYFailure yes
  RequestTTY auto

Only sites with a mixture of devices, some that don't support PTYs and
some where PTY allocation failure is catastrophic, will need to do
per-device RequestTTY.  I suspect that the last case will be very
rare.  So most of us will be happy with global ExitOnTTYFailure
settings and RequestTTY auto.

- Morty

More information about the openssh-unix-dev mailing list