Hi,

down votefavorite
<http://stackoverflow.com/questions/42110127/how-i-can-use-subprocess-module-for-connecting-to-linux-from-windows#>

Manual testing: I have installed putty in windows10 machine and by using
putty, I will do SSH connection to Linux machine(VM). I enter username and
password to access Linux machine(VM) then I enter different commands to
install application in Linux machine.

Automation: I want to automate above manual task by using python standard
subprocess module. I don't want to use third party libraries like paramiko,
pexpect etc. I am running script from windows machine. Please help me.

Below is the code( First I am trying to connect linux machine from
windows10).

import subprocess
cmd = "ssh root@10.106.213.235"
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr =subprocess.PIPE, bufsize=1,shell=True)

output: Process finished with exit code 0

code 0 means i believe there is no error in the script. But how i can
confirm that windows machine is connected to linux machine. while running
this script, am i able to see the shell?.

I am new to programming. Please provide your inputs which is really helpful
for me.

Thanks & Regards,

Basavaraj
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to