Force to assign a terminal in ssh

If you use ssh in a script and try to give commands from standard input, you may get the following error.
Pseudo-terminal will not be allocated because stdin is not a terminal.
In such a case, specifying two -t's (i.e. 'ssh -t -t ...') solves the problem. -tt also works.

Note that if the input side has a terminal (i.e., the input is done manually at the terminal), only one -t need be specified.

No comments:

Post a Comment