On 10/02/17 06:48, Basavaraj Lamani wrote: > 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.
The way I'd do that is write a Linux shell script to do all the Linux work then use Python to ftp(*) a copy of the script to the Linux box and just use ssh to run that script. Trying to use subprocess to drive an interactive ssh session is an exercise in frustration which I would avoid if at all possible. Running a single command is much easier. (*)Of course that assume you have an ftp server running on Linux... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor