Supposedly, pssh's -x option passes along extra SSH command-line arguments. SSH's "-t" option should have taken care of the "Pseudo-terminal" error. Is there another pssh/ssh option that should be used?
# pssh -i -H [email protected] -H [email protected] -x "-t -i /tmp/key.pem" 'sudo hostname'
[1] 13:46:54 [FAILURE] [email protected] 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] [email protected] 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
Without the "-t" and the "sudo", the command works fine, but I need to run some commands as sudo.
# pssh -i -H [email protected] -H [email protected] -x "-i /tmp/key.pem" 'hostname'
[1] 14:08:35 [SUCCESS] [email protected]
ip-10-0-0-140
[2] 14:08:35 [SUCCESS] [email protected]
ip-10-0-0-139
Try running pssh like this, so that the "-t" option is specified twice:
pssh -i -H ec2-user@... -x "-t -t -i /tmp/key.pem" 'sudo hostname'
^^^^^
The ssh man page says this about "-t" (emphasis added):
-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.
You are apparently running pssh in such a way that ssh has no local tty. So you have to arrange for ssh to be run with "-t" specified twice. This forces ssh to request a remote tty, despite not having a local tty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With