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()
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()