Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Local> ssh-keygen
  2. Generating 1024-bit dsa key pair
  3. 9 o.oOo..oOo.o
  4. Key generated.
  5. Passphrase :
  6. Again :
  7. Private key saved to /home/local/.ssh2/id_dsa_1024_a
  8. Public key saved to /home/local/.ssh2/id_dsa_1024_a.pub
  9.  
  10. Local> cd ~/.ssh2
  11. Local> echo "IdKey id_dsa_1024_a" > identification
  12. Local> scp id_dsa_1024.pub remote@remote-host:~/.ssh2/local.pub
  13.  
  14. Remote> ssh-keygen
  15. ...omit...
  16. Remote> cd ~/.ssh2
  17. Remote> echo "Key local.pub" > authorization
  18.  
  19. conn = paramiko.SSHClient()
  20. conn.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  21. conn.connect(remote-host, 22, username=remote,password='')
  22.  
  23. import os
  24. import paramiko
  25. ssh = paramiko.SSHClient()
  26. ssh.load_host_keys(os.path.abspath('.ssh/known_hosts'))
  27. ssh.connect(some_host_in_known_hosts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement