Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect('200.204.1.4', 22, username="", password="")
- stdin, stdout, stderr = ssh.exec_command("grep bob /etc/hosts")
- out = stdout.readlines()
- file = open("GESA.txt", "w+")
- for line in out:
- file.write(line)
- file.close()
- # print("comand executted")
- # print("out")
- ssh.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement