so i have created a paramiko ssh code that will ssh into a begalbone black, but when i go to run a python script in the interface it goes into limbo without any output, the python program on the begalbone is expecting user input. does anyone know how to get it to output the python programs output and receive input from the user?
i tried someones one liner that is blocked out as it did not help much, it seems to not locate the file.
this is the code i have so far
import paramiko import time
hostname ="192.168.0.120" port =22 user="****" passs="****"
client=paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname,port=port,username=user,password=passs)
#stdout = client.exec_command('python3 -c "exec(\\"' + open('fw102c_control.py','r').read().encode('base64').strip('\n') + '\\".decode(\\"base64\\"))"' )[1]
while True:
try:
cmd = input("$> ")
if cmd == "exit": break
stdin, stdout, stderr=client.exec_command(cmd)
print ("stderr: ", stderr.readlines())
print ("pwd: ", stdout.readlines())
print (stdout.read().decode())
print (stderr.read().decode())
except KeyboardInterrupt:
break
client.close() except Exception as err:
print(str(err))