"Force psuedo-tty allocation" 不转换为 pssh
"Force psuedo-tty allocation" doesn't translate to pssh
据推测,pssh 的 -x 选项会传递额外的 SSH 命令行参数。 SSH 的“-t”选项应该已经解决了 "Pseudo-terminal" 错误。是否应该使用另一个 pssh/ssh 选项?
# pssh -i -H ec2-user@xxx.xxx.xxx.xx1 -H ec2-user@xxx.xxx.xxx.xx2 -x "-t -i /tmp/key.pem" 'sudo hostname'
[1] 13:46:54 [FAILURE] ec2-user@xxx.xxx.xxx.xx1 Exited with error code 1
Stderr: Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo
[2] 13:46:54 [FAILURE] ec2-user@xxx.xxx.xxx.xx1 Exited with error code 1
Stderr: Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo
没有“-t”和 "sudo",该命令工作正常,但我需要 运行 一些命令作为 sudo。
# pssh -i -H ec2-user@xxx.xxx.xxx.xx1 -H ec2-user@xxx.xxx.xxx.xx2 -x "-i /tmp/key.pem" 'hostname'
[1] 14:08:35 [SUCCESS] ec2-user@xxx.xxx.xxx.xx1
ip-10-0-0-140
[2] 14:08:35 [SUCCESS] ec2-user@xxx.xxx.xxx.xx2
ip-10-0-0-139
像这样尝试 运行ning pssh,以便指定“-t”选项两次:
pssh -i -H ec2-user@... -x "-t -t -i /tmp/key.pem" 'sudo hostname'
^^^^^
ssh man page 关于“-t”的说法(强调):
-t
Force pseudo-terminal 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.
您显然 运行宁 pssh 的方式使 ssh 没有本地 tty。因此,您必须将 ssh 设置为 运行,并指定两次“-t”。这会强制 ssh 请求远程 tty,尽管没有本地 tty。
据推测,pssh 的 -x 选项会传递额外的 SSH 命令行参数。 SSH 的“-t”选项应该已经解决了 "Pseudo-terminal" 错误。是否应该使用另一个 pssh/ssh 选项?
# pssh -i -H ec2-user@xxx.xxx.xxx.xx1 -H ec2-user@xxx.xxx.xxx.xx2 -x "-t -i /tmp/key.pem" 'sudo hostname'
[1] 13:46:54 [FAILURE] ec2-user@xxx.xxx.xxx.xx1 Exited with error code 1
Stderr: Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo
[2] 13:46:54 [FAILURE] ec2-user@xxx.xxx.xxx.xx1 Exited with error code 1
Stderr: Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo
没有“-t”和 "sudo",该命令工作正常,但我需要 运行 一些命令作为 sudo。
# pssh -i -H ec2-user@xxx.xxx.xxx.xx1 -H ec2-user@xxx.xxx.xxx.xx2 -x "-i /tmp/key.pem" 'hostname'
[1] 14:08:35 [SUCCESS] ec2-user@xxx.xxx.xxx.xx1
ip-10-0-0-140
[2] 14:08:35 [SUCCESS] ec2-user@xxx.xxx.xxx.xx2
ip-10-0-0-139
像这样尝试 运行ning pssh,以便指定“-t”选项两次:
pssh -i -H ec2-user@... -x "-t -t -i /tmp/key.pem" 'sudo hostname'
^^^^^
ssh man page 关于“-t”的说法(强调):
-t
Force pseudo-terminal 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.
您显然 运行宁 pssh 的方式使 ssh 没有本地 tty。因此,您必须将 ssh 设置为 运行,并指定两次“-t”。这会强制 ssh 请求远程 tty,尽管没有本地 tty。