Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def StopAll(path,IP,ROOT,PASSWD):
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect('%s'%IP, username='%s'%ROOT,password='%s'%PASSWD)
- stdin, stdout, stderr = ssh.exec_command("cd /etc/init.d")
- stdin, stdout, stderr = ssh.exec_command("pwd")
- print stdout.read().strip()
- sftp = paramiko.SFTPClient.from_transport(ssh)
- sftp.cd(path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement