Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- import time
- strComputer = '10.0.6.35'
- strUser = 'UserID'
- strPwd = 'WackyPassword'
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(hostname=strComputer, username=strUser, password=strPwd)
- channel = client.invoke_shell()
- time.sleep(3)
- channel.send('ls n')
- time.sleep(3)
- output = channel.recv(2024)
- print(output)
- # Close the connection
- client.close()
- print('Connection closed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement