Bug 1716 - tty allocation is not properly documented
Summary: tty allocation is not properly documented
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 5.3p1
Hardware: Other Linux
: P2 enhancement
Assignee: Darren Tucker
URL:
Keywords:
Depends on:
Blocks: V_6_9
  Show dependency treegraph
 
Reported: 2010-02-27 02:31 AEDT by Vincent Lefevre
Modified: 2016-08-02 10:41 AEST (History)
1 user (show)

See Also:


Attachments
Clarify pseudo-terminal behaviour. (1.83 KB, patch)
2015-04-28 14:29 AEST, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lefevre 2010-02-27 02:31:19 AEDT
It seems that by default (i.e. without -t or -T ssh option), tty allocation is done only when one doesn't provide a command. If the user provides a command, no tty allocation occurs by default:

ypig:~> ssh localhost echo \$TERM

ypig:~> ssh -t localhost echo \$TERM
xterm-debian
Connection to localhost closed.

This behavior is not documented in the ssh/sshd man pages.

In the ssh man page, I can only see:

  If a pseudo-terminal has been allocated (normal login session), the
  user may use the escape characters noted below.

but this is very ambiguous (what is a "normal login session"?). Also, I wonder whether there's a difference between "pseudo-tty" and "pseudo-terminal"; the man page should be consistent.

The sshd man page has:

  command="command"
    Specifies that the command is executed whenever this key is used
    for authentication.  The command supplied by the user (if any) is
    ignored.  The command is run on a pty if the client requests a
    pty; otherwise it is run without a tty. [...]

but this is just documentation about command="...".
Comment 1 Darren Tucker 2015-04-28 14:29:13 AEST
Created attachment 2610 [details]
Clarify pseudo-terminal behaviour.

Here's the updated text:

"""
When the user's identity has been accepted by the server, the server
either executes the given command as a non-interactive session, or if no
command has been specified, logs into the machine and gives the user a
normal shell as an interactive session.  All communication with the
remote command or shell will be automatically encrypted.

If an interactive session is requested ssh by default will request a
pseudo-terminal (pty) if the client has one, otherwise it will not
request one.  The flags -T and -t can be used to override this behaviour.

If a pseudo-terminal has been allocated the user may use the escape
characters noted below.
"""
Comment 2 Darren Tucker 2015-05-06 15:46:07 AEST
I have just committed the man page change and it will be in the 6.9 release.  Thanks for the report.
Comment 3 Damien Miller 2016-08-02 10:41:19 AEST
Close all resolved bugs after 7.3p1 release