简体   繁体   English

stty:标准输入:使用pdsh或ssh时参数无效

[英]stty: standard input: Invalid argument when using pdsh or ssh

I want to run a simple script from remote machine. 我想从远程机器运行一个简单的脚本。 The script contains the following: 该脚本包含以下内容:

#!/usr/bin/python

import os
print str(os.popen('stty size', 'r').read())

If I run it from local machine I get fine output, something like 36 138 . 如果我从本地机器运行它,我会得到很好的输出,如36 138 If I try to run it from another machine, I get <ip>: stty: standard input: Invalid argument (using ssh ot pdsh). 如果我尝试从另一台机器运行它,我得到<ip>: stty: standard input: Invalid argument (使用ssh ot pdsh)。

The problem is I can't change the script that is using the stty command. 问题是我无法更改使用stty命令的脚本。 This is a common script, which I write wrapper to. 这是一个常见的脚本,我编写了包装器。 Suggestions ? 建议?

As BroSlow said, ssh -t will solve the problem if using ssh . 正如BroSlow所说,如果使用sshssh -t将解决问题。

If using pdsh via ssh , I used the following: 如果通过ssh使用pdsh ,我使用以下内容:

export PDSH_SSH_ARGS_APPEND="-tt -q"
pdsh -w ${machine_list} -S -R ssh ${cmd}

PDSH_SSH_ARGS_APPEND is used to append arguments to the ssh command generated by the pdsh , as the name hints. PDSH_SSH_ARGS_APPEND用于将参数附加到pdsh生成的ssh命令,如名称提示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取 stty:标准输入:通过 ssh 隧道使用 scp 时设备的 ioctl 不合适 - Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel stty:标准输入:设备的 ioctl 不合适 - stty: standard input: Inappropriate ioctl for device 如何抑制“stty:'标准输入':设备的 ioctl 不合适”错误 - How to supress the “stty: 'standard input': Inappropriate ioctl for device” error 使用 clone() 时出现无效参数错误 - Invalid Argument error when using clone() 来自crontab的ssh返回&#39;tcgetattr:无效的参数&#39; - ssh from crontab returning 'tcgetattr: Invalid argument' 当将字节数写入标准输入或标准输出中时,在if块中评估write()系统调用的哪个参数 - Which argument of write() sys-call is evaluated in an if block when the number of bytes are written either into standard input or standard output 使用pdsh通过linux解析内联python命令 - Parsing inline python command via linux using pdsh 使用ssh连接时是否可以自动向终端输入值? - Is it possible to automatically input value to the terminal when using an ssh connection? Stty在使用Python子进程时变得疯狂 - Stty getting insane on using Python subprocess write()返回错误:使用串行端口时参数无效 - write() returns error:invalid argument when using serial port
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM