【发布时间】:2009-10-04 06:06:29
【问题描述】:
我在我的应用程序中使用 ssh,并且必须将“-t -t”传递给 ssh 才能使其正常工作。否则,我的应用程序的标准输入会受到对 ssh 的调用的干扰。通过 -t -t 强制伪终端 ssh 可避免此问题,但会导致从 ssh 返回以下晦涩的错误消息,尽管应用程序似乎可以正常工作:
tcgetattr: Inappropriate ioctl for device
我想摆脱这条消息以防止它发生,而不是仅仅压制它,但我不确定它为什么会出现以及我应该做些什么来阻止它。我只有在 -t -t 传递给 ssh 时才会收到消息。
请注意这里提出了类似的问题:
http://www.perlmonks.org/?node_id=664789
ssh 的手册页说:
-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.
【问题讨论】: