pgAdmin4: Unable to connect to Amazon EC2 via SSH Tunnel

眉间皱痕 提交于 2019-12-11 01:48:31

问题


I have Amazon EC2 instance running Ubuntu. I have installed and configured PostgreSQL.

Contents of the file /etc/postgresql/9.3/main/pg_hba.conf:

local  all     all                   md5
host   all      all    0.0.0.0/0     md5

Also in postgresql.conf I have set listen_addresses='*'.

The test command below is successfully starting psql console.

psql -U postgres testdb

Now I am trying to connect pgAdmin4 from MacOS. I have created a SSH tunnel with following command:

ssh -i ~/.ssh/test.pem -fN -L 5433:localhost:5432 ubuntu@mytestdomain.com

Now I have following details in pgAdmin:

When I save, I get this output: Unable to connect to server: server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request.

What am I doing wrong ?

来源:https://stackoverflow.com/questions/43718604/pgadmin4-unable-to-connect-to-amazon-ec2-via-ssh-tunnel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!