大网数据广告活动
服务器运维问答

Connect to RabbitMQ (Amqp) via ssh gateway

· 52CE 我爱测

I have the following situation: DevMachine (D) need to connect to a gateway/bastion server (G) and then be able to talk to another server serving RabbitMQ (R) traffic on port 5672. I tried using an ssh tunnel to the gateway: ssh …

问题原文

原帖链接 · Urjit · CC BY-SA 3.0

I have the following situation: DevMachine (D) need to connect to a gateway/bastion server (G) and then be able to talk to another server serving RabbitMQ (R) traffic on port 5672.

I tried using an ssh tunnel to the gateway: ssh -L 5672:localhost:5672 G and next I want the gateway instance to let me connect to R's 5672. How do I accomplish that? I feel like I am missing a step here.

What I want: D ->G -> R. What I am getting is D ->G. If I had a rabbitmq instance running locally on G - this works but what I want is to essentially use G as a VPN.

Thanks!

已采纳解答

原帖链接 · Jakuje · CC BY-SA 3.0

If you want to connect to remote host, you need to use its name, not the localhost:

ssh -L 5672:R:5672 G

in this way, you should be able to access host R on localhost:5672.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。