Sudo Python code to connect to remote server but I am not getting any output. I am able to connect to remote using pexpect but on windows it does 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()