Guest User

Untitled

a guest
Dec 10th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. # sshpy v1 by s0urd
  2. # simple ssh client
  3. # irc.gonullyourself.org 6667 #code
  4.  
  5. import paramiko
  6. import os, sys
  7.  
  8. ssh = paramiko.SSHClient()
  9. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  10. privatekey = os.path.expanduser('/home/rabia/private')
  11. mkey = paramiko.RSAKey.from_private_key_file(privatekey)
  12. ssh.connect('78.46.172.47', port=22, username='s0urd', password=None, pkey=mkey)
  13.  
  14. def sftp_chdir():
  15. path = '/home/s0urd/web'
  16. sftp = ssh.open_sftp();
  17. sftp.chdir(path)
  18.  
  19. def sftp_mkdir():
  20. sftp = ssh.open_sftp();
  21. sftp.mkdir('')
  22.  
  23. while True:
  24. pick = raw_input("sshpy: ")
  25. stdin, stdout, stderr = ssh.exec_command(pick)
  26. print stdout.readlines()
Add Comment
Please, Sign In to add comment