Paramiko: nest ssh session to another machine while preserving paramiko functionality (ProxyJump)

前端 未结 2 757
渐次进展
渐次进展 2021-01-03 01:11

I\'m trying to use paramiko to bounce an SSH session via netcat:

 MyLocalMachine ----||----> MiddleMachine --(netcat)--> AnotherMachine
 (         


        
2条回答
  •  借酒劲吻你
    2021-01-03 01:53

    Better to post this as a proposed answer, you can do the following:

    Code is not tested nor will work as it is very incomplete. I would recommend to check this amazing tut for reference http://www.revsys.com/writings/quicktips/ssh-tunnel.html

    From the middle machine

    "ssh -f user@anothermachine -L 2000:localhost:22 -N"
    

    From localmachine:

    paramiko.connect(middlemachine, 2000)
    

提交回复
热议问题