2012-11-15 40 views
0

我已經安裝了Ubuntu的服務器上PostgreSQL和我試圖連接到遠程的MacBook使用pgAdmin的該服務器。轄Postgres的遠程MAC使用ssh隧道

我創建了一個SSH隧道 -

macbook:~postgres$ ssh -L 5423:localhost:5432 [email protected] 

我可以使用PSQL上如預期的MacBook連接 - 在PGAdminIII我

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

在 '新建服務器註冊' 窗口」 m輸入以下憑據

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的憑據相同。

回答

0

在您的服務器,選擇md5作爲pg_hba.conf文件的密碼驗證。例如:

host all all 12.34.67.89 255.255.255.255 md5 

雖然12.34.67.89是您的遠程ip。我上週面臨同樣的問題。希望有所幫助。

+0

謝謝Maulana。我已經有了這一行(除了我有127.0.0.1/32作爲我的主機地址,因爲我使用的是隧道)。 –