袜子上的 Python ssh 客户端(代理)

编程入门 行业动态 更新时间:2024-10-26 15:14:21
本文介绍了袜子上的 Python ssh 客户端(代理)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以,我需要通过代理袜子连接到 SSH 服务器.我阅读了 paramiko 和twisted.conch 文档,但没有在那里找到代理袜子支持.

So, I need to connect to SSH server through proxy socks. I read paramiko and twisted.conch docs, but didn`t found proxy socks support there.

推荐答案

此套接字包装器允许您使用静态 ssh 隧道.我为我的问题找到了一个通用的解决方案:

This socket-wrapper allows you to use static ssh-tunnels. I found a common solution for my problem:

  • 使用paramiko SSHClient 类
  • 使用您自己的类扩展 SSHClient
  • 重新实现 connect() 方法:我们没有使用标准的套接字对象,而是从 python 包 sockipy
  • 传递给它一个固定的代理套接字
  • Use paramiko SSHClient class
  • Extend SSHClient with your own class
  • Re-implement the connect() method: Instead of using a standard socket object we pass to it a fixed proxied socket from the python package sockipy
  • 更多推荐

    袜子上的 Python ssh 客户端(代理)

    本文发布于:2023-11-23 11:15:18,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1621253.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:袜子   客户端   Python   ssh

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!