【发布时间】:2011-06-07 12:46:58
【问题描述】:
我在 Python 中运行 ssh,而不使用像 Paramiko 这样的外部库。我有理由这样做,而不是通过外部库。
基本上我在做subprocess.Popen("ssh -t bla -- command")
执行此操作时我收到以下消息:
Pseudo-terminal will not be allocated because stdin is not a terminal.
我使用 -t 运行它的原因是我希望远程命令在我杀死我的 python 脚本时终止。
当我尝试使用-t -t(强制它)时,我收到以下消息:
tcgetattr: Inappropriate ioctl for device
有没有办法可以通过 Python 使用-t 运行我的 ssh 命令?
【问题讨论】:
-
如果你可以使用远程 sshd 设置,这应该会有所帮助:superuser.com/questions/396994/…