English 中文(简体)
用户/服务器之间现有短距离的电网
原标题:telnet to a device from server, over an existing ssh connection between client / server

这里是问题。 我正在使用我的文字把一个装置直接连接到电话网上(,从我的窗). <=(电话:1)=>to the Tool)。 基本上,我的文字在TL1上进行了一些指挥,掌握了产出,并按参数价值进行处理。

This device will be install on another network, which i can t reach anymore by telnet directly. Now, i have to start an ssh connection on the specific server and then, start the telnet session from there. (from my windows desktop <=(ssh)=> server <=(telnet)=> to the device)

I understand the basic of paramiko... i found that code on jessenoler website:

import paramiko
ssh.connect( 127.0.0.1 , username= jesse , password= lol )
stdin, stdout, stderr = ssh.exec_command("uptime")
type(stdin)
stdout.readlines()
# output:
# [ 13:35  up 11 days,  3:13, 4 users, load averages: 0.14 0.18 0.16
 ]

我可以说明我如何能够从服务器上启动一个电话网。 如果使用:

ssh.exec_command("telnet 10.10.10.10 10001")

我知道解决我问题最容易的方法是在服务器上安装on,但可以安装。 有些人面临着这样的问题? 感谢投入!

最佳回答

You should setup an SSH tunnel instead of opening a normal connection. This can be done from the command line on your client with -L localport:server:remoteport, or it can be done from python with paramiko.

查阅<>和

在您设立这一机构时,请在指定为当地港口的港口与电话网连接 localhost

问题回答

暂无回答




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签