I was unable to access a remote AWS postgres database via things
like psql -h *EC2ExternalIP* -U *me*
. I would get:
psql -h *EC2ExternalIP* -U *me*
psql: could not connect to server: Operation timed out
Is the server running on host *EC2ExternalIP* and accepting
TCP/IP connections on port 5432?
same thing trying a simple telnet connection to this port:
curl telnet://*EC2ExternalIP*:5434
curl: (7) Failed to connect to *EC2ExternalIP* port 5434:
Operation timed out
and even though i could access other services (eg, apache) on this same EC2ExternalIP.
So I poked around at threads like these:
How to connect to an remote PostgreSQL database on Ubuntu using pgAdmin3?
https://askubuntu.com/questions/423165/remotely-access-postgresql-database/827358#827358
and they helped me to ensure I'd made appropriate modifications to
postgresql.conf
and pg_hba.conf
; the right settings for you will
depend on your instance's security concerns. But it is still not
working.
What should I do to make this DB accessible?