标签:exec connect env name param 执行 com exe password
#!/usr/bin/env python
#-*- encoding -*-
import paramiko
transport = paramiko.Transport((‘192.168.11.181‘, 22))
transport.connect(username=‘ahwater‘, password=‘Aa7788..‘)
ssh = paramiko.SSHClient()
ssh._transport = transport
stdin, stdout, stderr = ssh.exec_command(‘netstat -na‘)
print stdout.read()
stdin, stdout, stderr = ssh.exec_command(‘hostname‘)
print stdout.read()
transport.close()
标签:exec connect env name param 执行 com exe password
原文地址:http://www.cnblogs.com/ruiy/p/7143123.html