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.
-t
is better than with-t
, kind of the opposite to this question. – Cyker Jul 30 '18 at 01:21-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:27ssh
with separate stdin, stdout, stderr AND tty. – Kamil Maciorowski Nov 02 '21 at 05:46