防火墙后面的设备通过 ssh 连接
周围有一些类似的问题,但没有一个真正具体回答了我的问题。(例如 连接到防火墙后面的设备)
我想要的是一个中央服务器,它接收来自个人防火墙后面的多个(例如100个)嵌入式设备的心跳。这些设备需要能够做两件事。
- 从服务器获取新配置。我 怀疑我可以通过 http 从设备获取到 服务器并拉取一些 XML,然后 重新加载它自己的配置。
- 打开与服务器的 ssh 连接 允许管理员登录 设备的命令行并执行 维护和故障排除 远程设备 => server <= admin 且 admin 可以访问 bash 命令行或等效命令。
该设备是一款运行 Linux 的低功耗嵌入式设备。 python 中的解决方案会更好(我正在考虑用 paramiko 来实现 ssh),但我对其他解决方案持开放态度。最主要的是专用网络中不会有技术用户,因此它应该能够插入消费级 ADSL 调制解调器,获取 DHCP 地址,所有这些都应该可以工作。我可以预先在设备上预加载任何内容,例如用于无密码 ssh 的 ssh 证书等。
有人知道吗?
干杯
马克
There have been a few questions like this around the place but none have really answered my question specifically.(for example Connecting to device behind firewall )
What I want is a central server, that receives a heartbeat from multiple ( say 100's) embedded devices behind personal firewalls. These devices need to be able to do two things.
- Grab new config from the server. I
suspect I can just do this via a
http get from the device to the
server and pull down some XML, then
reload its own config. - Open an ssh connection to the server
to allow an admin to login to the
command line of the device and do
maintenance and troubleshooting
remotely.ie device => server <= admin and admin can get to bash command line or equivalent.
the device is a low powered embedded device that will be running linux. A solution in python would be preferable (im thinking something with paramiko for the ssh) but im open to other solutions. The main thing is there is there will be no technical users in the private network, so it should be able to plug into a consumer grade ADSL modem, get a DHCP address and all this should work. I can preload the device with anything before hand, for example ssh certificates for passwordless ssh etc.
anybody got any idea's?
Cheers
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以设置 ssh 隧道(从 python 脚本或控制台):
然后您只需登录到主服务器,然后
ssh bar@localhost -p 10022
您应该有 ssh 密钥,所以您没有输入密码(谷歌搜索“无密码 ssh”)。
You can setup ssh tunnel (from python script or from console):
Then you can simply login to main server and then
ssh bar@localhost -p 10022
You should have ssh keys, so you don't have to put password (google about "ssh without password").
更复杂的方法可能是某种类型的 防火墙打洞。
但第二,也许这不是必需的,因为只涉及一个防火墙。诀窍是让您的嵌入式设备首先启动出站连接。
A more elaborate method might be some type of firewall hole punching.
On second though, maybe this is not necessary, since there is only one firewall involved. The trick is to get your embedded device to initiate an outbound connection first.