【发布时间】:2019-10-29 20:49:00
【问题描述】:
我已经通过 forge 配置了一个 EC2 实例。执行此操作时,您没有机会下载 PEM 密钥。相反,我已将本地密钥添加到 forge SSH 配置中。
我现在可以使用ssh forge@IPADDRESS SSH 进入 EC2 实例 - 一切正常。
我在同一个 VPC 中有一个 RDS 实例设置。我已经在 EC2 实例中对此进行了测试,并且可以:
- 通过终端中的我的 EC2 实例连接到 MySQL。使用:
mysql -h RDSINSTANCE.ENDPOINT.eu-west-2.rds.amazonaws.com -u USERNAME -p
- 检查 3306 端口是否已通过 telnet 打开。
telnet RDSINSTANCE.ENDPOINT.eu-west-2.rds.amazonaws.com 3306
以上所有似乎都表明 RDS 实例与 EC2 实例有连接。
我现在需要从我的笔记本电脑打开一个 SSL 隧道,以连接 sequelpro。由于没有 PEM 文件,我使用以下命令打开了一个 SSH 隧道:
ssh -L 3307:FORGE-PRIVATE-IP:3306 forge@FORGE-PUBLIC-IP
这似乎工作正常。但是,当尝试使用设置通过 sequel pro 连接到 SQL 时:
主机:127.0.0.1 港口:3307 用户:用户名 密码:密码
我从 seqelpro 收到以下错误:
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
在终端中处于详细模式:
debug1: Connection to port 3307 forwarding to 172.30.0.110 port 3306 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel 2: free: direct-tcpip: listening port 3307 for 172.30.0.110 port 3306, connect from 127.0.0.1 port 56172 to 127.0.0.1 port 3307, nchannels 3
AWS 支持似乎认为这是因为隧道设置不正确,但我不确定其他任何方式。
【问题讨论】:
标签: amazon-web-services amazon-ec2 ssh amazon-rds ssh-tunnel