Why does ssh allocate a tty on server side?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
0
down vote

favorite












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.







share|improve this question





















  • Related - serverfault.com/questions/593399/….
    – slm♦
    Jul 30 at 0: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 at 1:21










  • Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
    – slm♦
    Jul 30 at 1: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 at 1:27
















up vote
0
down vote

favorite












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.







share|improve this question





















  • Related - serverfault.com/questions/593399/….
    – slm♦
    Jul 30 at 0: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 at 1:21










  • Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
    – slm♦
    Jul 30 at 1: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 at 1:27












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.







share|improve this question













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.









share|improve this question












share|improve this question




share|improve this question








edited Jul 29 at 23:32
























asked Jul 29 at 23:06









Cyker

1,2651223




1,2651223











  • Related - serverfault.com/questions/593399/….
    – slm♦
    Jul 30 at 0: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 at 1:21










  • Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
    – slm♦
    Jul 30 at 1: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 at 1:27
















  • Related - serverfault.com/questions/593399/….
    – slm♦
    Jul 30 at 0: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 at 1:21










  • Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
    – slm♦
    Jul 30 at 1: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 at 1:27















Related - serverfault.com/questions/593399/….
– slm♦
Jul 30 at 0:39




Related - serverfault.com/questions/593399/….
– slm♦
Jul 30 at 0: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 at 1:21




@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 at 1:21












Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
– slm♦
Jul 30 at 1:22




Yeah it's the opposite of your Q but in explaining the reverse explains your Q, at least IMO.
– slm♦
Jul 30 at 1: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 at 1:27




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 at 1:27















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f459233%2fwhy-does-ssh-allocate-a-tty-on-server-side%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f459233%2fwhy-does-ssh-allocate-a-tty-on-server-side%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)