I have a script which connects to a remote server and check if some package is installed:ssh root@server 'bash -s' < myscript.shmyscript.sh:OUT=`rpm -qa | grep ntpdate`if [ $OUT !=  ] ; then    echo ntpdate already installedelse    yum install $1fiThis example could be simplified. Here is myscript2.sh which has same problem:read -p Package is not installed. Do you want to install it (y/n)? choiseMy problem is that bash can not read my answers interactively.Is there a way to execute local script remotely without losing ability to prompt user?
Bash: interactive remote prompt
bash;shell script;ssh;stdin;read
Try something like this:$ ssh -t yourserver $(<your_script)The -t forces a tty allocation, $(<some_file) reads the whole file and in this cases passes the content as one argument to ssh, which will be executed by the remote user's shell.Works for me, not sure if it's universal though.