将dbeaver连接到远程服务器上托管的postgres

时间:2017-02-22 21:58:33

标签: ssh ssh-tunnel dbeaver

我们正在使用postgres db托管两台服务器,(原谅我的行话)我们通常通过终端连接如下:

local =>(使用谷歌身份验证)ssh服务器1 =>(使用谷歌身份验证)ssh服务器2 => psql -h主机名-U Uname -d DBName

但是,这是一个繁忙的过程,我想通过Dbeaver连接到数据库。

我在线浏览,我认为可以通过SSH隧道完成,但我只能跳过一台服务器,而且它不会连接到另一台服务器。

感谢你的帮助,提前谢谢!

我的试验:

ssh -A -t host1.host.server1.com \ -L 5432:localhost:5432 \ ssh -A -t queries.host.server2.com \ -L 5432:localhost:5432

我无法成功连接。即使我连接了,T'd只能连接到机器但是要访问DB我必须运行psql命令。在这之后我完全迷失了。

1 个答案:

答案 0 :(得分:4)

这对我有用,但只能连接到一个远程主机。编辑您的连接,然后在“连接设置”中输入以下内容:

Host: localhost
Database: your_database_name
User: your_database_user_name
Password: your_database_password

然后在连接设置 - >网络屏幕,输入以下内容:

Check "Use SSH Tunnel"
Host/IP: your_remote_host_name or your_remote_ip
Port: 22
User Name: your_remote_user (not database user)
Authentication Method: Public Key
Private Key: path_to_your_private_key (.pem or .ppk file)
Passphrase: your_remote_user_password (not database password)

然后测试连接。

相关问题