Monday, December 19, 2016

Pysftp connection

import pysftp

ssh = pysftp.paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect( IP, username = server_username, password = server_password )
chan = ssh.invoke_shell()
ssh._transport.set_keepalive(50000)
stdin, stdout, stderr = ssh.exec_command(" <your shell command>")
stdout.readlines()

No comments:

Post a Comment