Stty: standard input: invalid argument when using pdsh or ssh

I want to run a simple script from a 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 a local machine, I get a beautiful output, something like 36 138. If I try to run it from another machine, I get <ip>: stty: standard input: Invalid argument(using ssh ot pdsh).

The problem is that I cannot change the script that uses the stty command. This is a common script to which I am writing a wrapper. Suggestions?

+4
source share
1 answer

As BroSlow said, it ssh -twill solve the problem if used ssh.

pdsh ssh, :

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

PDSH_SSH_ARGS_APPEND ssh, pdsh, .

+3

Source: https://habr.com/ru/post/1524253/


All Articles