Python Learning SSH login (take Linux for example);
Python has two modules to enable SSH login and issued command line;
Pexpect
1. Install third-party modules;
Easy_install Pexpect
2.PEXPECT SSH login and issued orders;
650) this.width=650; "style=" width:500px;height:431px; "src=" http://s3.51cto.com/wyfs02/M02/4C/D8/ Wkiol1rggmkak9luaalpuu3gvsk290.jpg "title=" 2014-10-21_163113.jpg "alt=" wkiol1rggmkak9luaalpuu3gvsk290.jpg "border = "0" height= "431" hspace= "0" vspace= "0" width= "/>"
3. This time is the human-computer Interaction test method: Test results;
650) this.width=650; "style=" width:1000px;height:200px; "src=" http://s3.51cto.com/wyfs02/M01/4C/D8/ Wkiol1rggxfieewpaairy93t4y4993.jpg "title=" 2014-10-21_163501.jpg "alt=" wkiol1rggxfieewpaairy93t4y4993.jpg "border = "0" height= "hspace=" 0 "vspace=" 0 "width="/> "
Paramiko
1. Install third-party modules;
Easy_install Paramiko
2.paramiko SSH Login and issued command:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4C/D7/wKiom1RGIwiifIh6AAGn2pxLIbs920.jpg "style=" float: none; "title=" 2014-10-21_163113.jpg "alt=" Wkiom1rgiwiifih6aagn2pxlibs920.jpg "/>
3. Test results;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4C/D8/wKioL1RGI1TgBqNaAAFbwKmf0xo147.jpg "style=" float: none; "title=" 2014-10-21_163501.jpg "alt=" Wkiol1rgi1tgbqnaaafbwkmf0xo147.jpg "/>
This article from "Seven" blog, declined reprint!
Python Learning SSH login and issued command