Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python
- import paramiko
- import time
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- print("ok1")
- ssh.connect('10.20.7.104', username='user1', password='passbkcuser')
- #time.sleep(5)
- print("logOn")
- stdin, stdout, stderr = ssh.exec_command("sudo -S reboot")
- time.sleep(5)
- stdin.write("passbkcuser\n")
- #time.sleep(5)
- print("command done")
- stdin.flush()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement