python远程脚本

#!/usr/bin/python
import paramiko
host='192.168.4.101'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username='root', password='redhat')
stdin, stdout, stderr = ssh.exec_command('ls /')
ssh.exec_command('touch /hcy.txt')
posted @ 2018-03-23 18:55  virlix  阅读(327)  评论(0编辑  收藏  举报