Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- hostname= '138.68.108.210'
- username = 'itsuser'
- port = 50684
- password = '-its?ch4'
- try:
- client = paramiko.SSHClient()
- client.load_system_host_keys()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(username= username, password= password, hostname= hostname, port= port)
- stdin, stdout, stderr = client.exec_command('uname -a')
- for line in stdout.read().splitlines():
- print(line)
- client.close()
- except Exception as e:
- print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement