Advertisement
Guest User

Untitled

a guest
Feb 13th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. MyLocalMachine ---> MiddleMachine --(netcat)--> AnotherMachine
  2. ('localhost') ('1.1.1.1') ('2.2.2.2')
  3.  
  4. cli = paramiko.SSHClient()
  5. cli.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  6. proxy = paramiko.ProxyCommand('ssh user@1.1.1.1 nc 2.2.2.2 22')
  7. cli.connect(hostname='2.2.2.2', username='user', password='pass', sock=proxy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement