0

Basically when you run an interactive program on the server you need to use ssh -t instead of ssh. For example:

  • This works: ssh -t user@server top.

  • This doesn't work: ssh user@server top.

Question is: Why does ssh need a server-side tty for such programs? Is it possible to directly pipe data streams between the server program and the client side tty?


To add some details, we know the tty can multiplex stdout and stderr onto a single stream. This means if you run ssh -t then on the client side you won't be able to tell the difference between stdout and stderr, and to pipe them separately. Therefore I think a server-side tty in between breaks some of kind of transparency. It'd be nice if ssh makes running server-side programs exactly the same experience as if those programs were local.

Cyker
  • 4,274
  • 7
  • 36
  • 46
  • 1
    Related - https://serverfault.com/questions/593399/what-is-the-benefit-of-not-allocating-a-terminal-in-ssh. – slm Jul 30 '18 at 00:39
  • @slm I saw this one, but it was answering why without -t is better than with -t, kind of the opposite to this question. – Cyker Jul 30 '18 at 01:21
  • Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO. – slm Jul 30 '18 at 01:22
  • The explanation in that question favors without -t, but the fact is, there is -t, so there must something not covered in that question that favors -t, right? – Cyker Jul 30 '18 at 01:27
  • "a server-side tty in between breaks some of kind of transparency. It'd be nice if ssh makes running server-side programs exactly the same experience as if those programs were local." – Please see my Q&A pair: ssh with separate stdin, stdout, stderr AND tty. – Kamil Maciorowski Nov 02 '21 at 05:46

0 Answers0