I would like to actually ssh into a machine (not remotely execute a command like
ssh -i key.pem user@host 'bash -s' < script.sh) and then once that is complete run a command to launch an interactive command line program on the remote machine. Any ideas? Note all of this is done in a script and the end result should be a interactive command line program running within the shell on the remote host.
So far I have tried in Python 2.7 on Ubuntu 14.04
import os os.system("xterm -e ssh -tt -i key.pem -o StrictHostKeyChecking=no ubuntu@ip_address yRouter/src/yrouter --interactive=1 user")
xterm session closes immediately after. The "yrouter" is the executable on the remote machine and
--interactive=1 user are its arguments.
To clarify: the result after running the Python code above should be an
xterm (or any terminal window) open, already sshed into the remote host AND have the interactive command line program