Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import paramiko
- IP = '127.0.0.1'
- def main():
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(IP, port=22, username='admin', password='admin')
- stdin, stdout, stderr = client.exec_command('ls -l /tmp/')
- output_lines = stdout.readlines()
- client.close()
- for l in output_lines:
- print l.strip()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement