I understand all the security risks using ssh in this way, but what I need at the moment is a few line (bash) shell script capable to log-in to the target
server and just do a foo command and get back to the source host, something like:
while true
do
ssh target foo # Here I get the prompt for a password which
# I would like to give non-interactively
sleep 1
done
I do not want to use the ssh key based authentication because what I truly need is to simulate once a second (or so) the interactive log-in process (but not-interactively!).