Score:0

Difference between -t and -tt ssh

id flag

man ssh says:

-t Force pseudo-tty 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.

https://explainshell.com/explain?cmd=ssh+-tt

Multiple -t options force tty allocation, even if ssh has no local tty.

What does that mean specifically? If there is no shell on the system, does ssh create its own? What must happen that -tt fails?

Score:2
us flag

If you do this:

ssh -t user@server<<EOT
echo test
EOT

You'll get a message that states: Pseudo-terminal will not be allocated because stdin is not a terminal. In this case, stdin was feeding ssh, not your local shell/tty.

Using -tt will tell it to allocate regardless. This is one use-case, I'm sure there are other cases that can be applied to this, but stdin is one of the most obvious.


If there is no shell on the system, does ssh create its own?

No local tty for ssh is not suggesting that a local shell does not exist. The above example shows using stdin to stream into ssh.

What does that mean specifically?

It means it will force the tty allocation regardless of the local connection. See above example.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.