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 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
Without the "-t" and the "sudo", the command works fine, but I need to run some commands as 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