python:将telnet应用程序转换为ssh [英] python: convert telnet application to ssh

查看:44
本文介绍了python:将telnet应用程序转换为ssh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个 python telnet 客户端,通过 telnet 与服务器通信.但是,很多人告诉我它不安全.如何将其转换为 ssh?我是否需要完全重写我的程序?

I write a python telnet client to communicate with a server through telnet. However, many people tell me that it's no secure. How can I convert it to ssh? Should I need to totally rewrite my program?

推荐答案

只需通过 SSH 创建一个 TCP 隧道并通过那里中继所有数据,无需重新发明轮子.您可以在 TCP 隧道下的 SSH 文档中找到示例(例如 man ssh).

Just create a TCP tunnel via SSH and relay all the data through there, no need to reinvent the wheel. You can find examples in SSH docs under TCP tunneling (man ssh for instance).

但如果您真的想重写它,请查看 paramiko 项目.

But if you really want to rewrite it, then check out paramiko project.

这篇关于python:将telnet应用程序转换为ssh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆