python - Using Plink to run multiple remote commands in interactive shell session -
sudo python code connect remote server not getting output. able connect remote using pexpect on windows not work.
from subprocess import popen,pipe command = "plink.exe -ssh test@test.com -pw root123" sh = popen(command, stdin=pipe, stdout=pipe) sh.stdin.write('ls /\n') sh.stdin.write('ls /usr\n') sh.stdin.close() out = sh.stdout.read()
Comments
Post a Comment