How do I open postgres access?

Linode Staff

in the postgresql.conf file I put in to accept * connections, but I still can not connect to the database without going through the tunnel of the PUTTY connection. I need this access to the database to be released, how can I do it?

1 Reply

You'll want to ensure that PostgreSQL is listening on your public interface by setting listen_addresses = '*' in the postgresql.conf file. You can also use sudo netstat -plntu to show you what services are listening on which interface.

Additionally, you'll need to have your local IP address (or a range of addresses) set to allow access to which databases and logins you wish to use in the pg_hba.conf file. I strongly reccommend that you read through the security documentation for PostgreSQL before changing anything, but an example line allowing logins to any user/database with a password from the IP address 1.2.3.4 would be host all all 1.2.3.4 password.

Lastly, you'll also want to ensure that you do not have any iptables/ufw rules blocking the port that PostgreSQL is listening on (default is 5432). You may find the guides on iptables and ufw helpful here.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct