psql服务器ssh隧道身份验证失败

时间:2019-04-05 21:43:08

标签: postgresql ssh-tunnel

我正在尝试连接到远程服务器上的psql数据库。

所以我通过如下所示的ssh隧道连接到远程服务器

ssh -L 7777:psqlServerHost.com:5432 me@remoteServerHost.com

不幸的是,当我在本地的另一终端上尝试以下命令时,我无法正确进行身份验证

psql -h localhost -p 7777 -U user database

我会得到

FATAL:  password authentication failed for user

但是,如果我直接通过ssh进入me@remoteServerHost.com,我将能够使用以下命令以相同的凭据连接到数据库

psql -h psqlServerHost.com -U user database

我想这可能是我遗漏的某个配置文件,但是我似乎找不到任何对互联网有用的类似查询。

0 个答案:

没有答案
相关问题