ssh python结构
我不知道该怎么做。 我可以通过一些用户访问本地计算机,例如192.168.1.101。从那台计算机上,我可以访问另一个comp(通过vpn)10.0.132.17,只有从这里,我才能访问计算机10.0.132.15,在那里我需要部署脚本 因此,我需要:ssh python结构,python,ssh,deployment,fabric,Python,Ssh,Deployment,Fabric,我不知道该怎么做。 我可以通过一些用户访问本地计算机,例如192.168.1.101。从那台计算机上,我可以访问另一个comp(通过vpn)10.0.132.17,只有从这里,我才能访问计算机10.0.132.15,在那里我需要部署脚本 因此,我需要: $ ssh some_user@192.168.1.101 -> ssh another_user@10.0.132.17 -> ssh another_user@10.0.132.15 我可以做点什么吗:ssh_user@192.
$ ssh some_user@192.168.1.101 -> ssh another_user@10.0.132.17 -> ssh another_user@10.0.132.15
我可以做点什么吗:ssh_user@192.168.1.101-p 2222
并访问另一个_user@10.0.132.15
或者在PythonFabric中以某种方式编写env变量?使用显式隧道之外的另一个选项是设置ssh以通过代理透明地转发。在
~/.ssh/config
中输入如下内容:
Host proxy_midstage
User another_user
HostName 10.0.132.17
ProxyCommand ssh -q some_user@192.168.1.101 nc %h %p
Host proxy_final
User another_user
HostName 10.0.132.15
ProxyCommand ssh -q proxy_midstage nc %h %p
然后,命令
ssh proxy\u final
将直接跳转到部署服务器。假设fabric可以使用它,尽管我不是肯定的。从VPN运行th脚本?不,脚本是python fabric脚本。从我当地的公司运行。192.168.1.102好的。您需要的是SSH隧道。试试这个