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")
But the 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 yrouter
running.
ssh -i key.pem user@host
should give you an interactive login shell session after login...script.sh
and also show whats your target and where it is failing..ssh -X
(orY
); note that is uppercase for both. The remote machine needs to have X-windows running to run an X-windows app, but that's it. Or am I missing something?