使用ssh隧道在远程mac上管理来自PGAdmin的postgres

时间:2012-11-15 13:17:52

标签: ssh osx-mountain-lion ubuntu-12.04 pgadmin

我已经在Ubuntu服务器上安装了PostgreSQL,并且我正在尝试使用远程macbook上的PGAdmin连接到该服务器。

我创建了一个ssh隧道 -

macbook:~postgres$ ssh -L 5423:localhost:5432 postgres@mydomain.com

我可以按预期在macbook上使用psql连接 -

macbook:~ me$ psql -U postgres -p 5423 -h localhost
...
postgres=#

在PGAdminIII的“新服务器注册”窗口中,我输入以下凭据

Name - MyServer
Host - localhost
Port - 5423
Maintenance DB - postgres
Username - postgres
Password - <remote_postgres_password>

然而连接失败 -

Error connecting to the server: FATAL: password authentication failed for user "postgres"

不确定这里发生了什么,这些似乎与我用于psql的凭据相同。

1 个答案:

答案 0 :(得分:0)

在您的服务器中,选择md5作为pg_hba.conf文件上的密码验证。例如:

host all all 12.34.67.89 255.255.255.255 md5

虽然12.34.67.89是您的远程IP。我上周面临同样的问题。希望有所帮助。

相关问题