python paramiko

Solutions on MaxInterview for python paramiko by the best coders in the world

showing results for - "python paramiko"
Simon
13 Aug 2018
1import base64
2import paramiko
3key = paramiko.RSAKey(data=base64.b64decode(b'AAA...'))
4client = paramiko.SSHClient()
5client.get_host_keys().add('ssh.example.com', 'ssh-rsa', key)
6client.connect('ssh.example.com', username='strongbad', password='thecheat')
7stdin, stdout, stderr = client.exec_command('ls')
8for line in stdout:
9    print('... ' + line.strip('\n'))
10client.close()
11