我正在尝试复制命令
ssh -L8080:127.0.0.1:80 example.com
以及
ssh -R8080:127.0.0.1:80 example.com
使用python库sshtunnel
(https://github.com/pahaz/sshtunnel/)。你知道吗
所以我发现了
ssh -L8080:127.0.0.1:80 example.com
成为
server = SSHTunnelForwarder(
'example.com',
ssh_username="username",
ssh_password="password",
remote_bind_address=('127.0.0.1', 8080))
但我仍然无法理解如何复制命令
ssh -R8080:127.0.0.1:80 example.com
为什么不使用subprocess并在shell中运行命令呢?你知道吗
这是一个建议,以及取决于你需要用它做什么,如果只是运行命令或你需要做额外的操作!你知道吗
相关问题 更多 >
编程相关推荐