I have a python script that establishes ssh connected using os.system() function :
def livestream():
os.system('ssh -X [email protected]')
os.system('cd Desktop') #doesn't get executed on remote machine
I know that os.system() executes commands on the same machine.
Further, I need to execute a program present on the remote machine.
My question is how do I execute bash commands in python once ssh connection is established?