a guest May 22nd, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import paramiko
- remote_machine_name = raw_input('Enter the remote machine name:')
- ssh = paramiko.SSHClient()
- ssh.connect(remote_machine_name, username='xxx', password='yyy')
- print "connected successfully!"
- except paramiko.SSHException:
- print "connection error"
- stdin, stdout, stderr = ssh.exec_command('(cd path;./shellscript.sh)')
- print "stderr: ", stderr.readlines()
- print "stdout: ", stdout.readlines()
RAW Paste Data