ssh = paramiko.SSHClient()
ssh.connect(remote, username=username, password=password)
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command('some command')
exit_status = ssh_stdout.channel.recv_exit_status()
SSH module for python