[英]Multiple SSH tunnel hops with DBeaver
Can DBeaver create two SSH tunnels and then connect to a database? DBeaver 可以创建两个 SSH 隧道然后连接到数据库吗?
I have successfully created one SSH tunnel but not two.我已经成功创建了一个 SSH 隧道,但没有创建两个。
I am trying to connect to an AWS RDS database via Bastion host.我正在尝试通过 Bastion 主机连接到 AWS RDS 数据库。 Bastion host only allows SSH access from my corporate IP range.
堡垒主机仅允许从我的公司 IP 范围访问 SSH。 This means that when I am in the office I can connect to the RDS from DBeaver just fine:
这意味着当我在办公室时,我可以很好地从 DBeaver 连接到 RDS:
The issue arises when I work from home.当我在家工作时,就会出现这个问题。 I would have to add "zero" step to have an allowed IP address for the Bastion host connection: 0) Connect to the machine inside the office
我必须添加“零”步骤以获得允许的 IP 地址用于堡垒主机连接:0)连接到办公室内的机器
I have not yet managed to achieve this.我还没有做到这一点。 Has anyone got an idea of how to do this?
有没有人知道如何做到这一点?
Kudos to @erik258 for pointing me in the right direction.感谢@erik258为我指明了正确的方向。
I have created an SSH tunnel between an office machine and the Bastion host.我在办公机器和堡垒主机之间创建了一条 SSH 隧道。 When in the office machine, when I access
http://localhost:<local_port>
I am in effect communicating with the <RDS_endpoint>
on port <remote_port>
.在办公室机器中,当我访问
http://localhost:<local_port>
时,我实际上是在与端口<remote_port>
<RDS_endpoint>
上的 <RDS_endpoint> 通信。
Steps:脚步:
$ ssh -L <local_port>:<RDS_endpoint>:<remote_port> -i <path_to_ssh_key> ec2-user@<Bastion_host public IP>
$ ssh -L <local_port>:<RDS_endpoint>:<remote_port> -i <path_to_ssh_key> ec2-user@<Bastion_host 公共 IP>
<local_port>
- random port <local_port>
- 随机端口
<remote_port>
- port RDS endpoint listens to (5432 for PostgreSQL) <remote_port>
- RDS 端点侦听的端口(对于 PostgreSQL 为 5432)
<RDS_endpoint>
- endpoint specified on the AWS RDS page <RDS_endpoint>
- 在 AWS RDS 页面上指定的端点
localhost
, and "Port" as <local_port>
.localhost
,将“Port”设置为<local_port>
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.