标签:password python command import justin
import threading import paramiko import subprocess def ssh_command(ip,user,passwd,command): client = paramiko.SSHClient() #client.load_host_keys(‘/home/justin/.ssh/known_hosts‘) client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(ip,username=user,password=passwd) ssh_session=client.get_transport().open_session() if ssh_session.active: ssh_session.exec_command(command) print ssh_session.recv(1024) return ssh_command(‘192.168.100.131‘,‘justin‘,‘lovesthepython‘,‘id‘)
本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1771998
标签:password python command import justin
原文地址:http://jingshanls.blog.51cto.com/3357095/1771998