I am writing a "tool" - a couple of bash scripts that automate the installation and configuration on each server in the cluster.
The "tool" works from the main server. It lifts up and distributes it independently (through SCP) to any other server and unpacks copies through "batch" SSH.
When setting up, the tool issues remote commands, for example, the following from the main server: echo './run_audit.sh' | ssh host4 'bash -s' echo './run_audit.sh' | ssh host4 'bash -s' . This approach works in many cases, except when there is interactive behavior, since standard input is already in use.
Is there a way to run remote bash scripts interactively via SSH?
As a starting point, consider the following case: echo 'read -p "enter name:" name; echo "your name is $name"' | ssh host4 'bash -s' echo 'read -p "enter name:" name; echo "your name is $name"' | ssh host4 'bash -s'
In the above example, the clue never happens, how do I get around this?
Thanks in advance.
source share