How to disable postgresql port for out-server connection?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to disable postgresql port for out-server connection?
I installed on my dedicated server ubuntu 20.04, docker, and container with postgressql. I have problem beacouse I want that ubuntu blocked all connection with postgressql, out-server from domain, ip server etc, which added to server.
At the moment I can connect with PostgreSQL:
via ssh
via server ip. ip.ip.ip:5432/...
via all domain which added to nginx like domain1.com:5432 etc.
I want disabled connection via server ip and all domain which added to nginx
I installed on my dedicated server ubuntu 20.04, docker, and container with postgressql. I have problem beacouse I want that ubuntu blocked all connection with postgressql, out-server from domain, ip server etc, which added to server.
At the moment I can connect with PostgreSQL:
via ssh
via server ip. ip.ip.ip:5432/... via all domain which added to nginx like domain1.com:5432 etc.
I want disabled connection via server ip and all domain which added to nginx
(emphasis added)
It shouldn't be doing this afaics.
Quote:
Originally Posted by man postgres
-h hostname
Specifies the IP host name or address on which postgres is to listen for TCP/IP
connections from client applications. The value can also be a comma-separated list of
addresses, or * to specify listening on all available interfaces. An empty value
specifies not listening on any IP addresses, in which case only Unix-domain sockets can
be used to connect to the server. Defaults to listening only on localhost. Specifying
this option is equivalent to setting the listen_addresses configuration parameter.
-i
Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this
option, only local connections are accepted. This option is equivalent to setting
listen_addresses to * in postgresql.conf or via -h.
This option is deprecated since it does not allow access to the full functionality of
listen_addresses. It's usually better to set listen_addresses directly.
How are you starting postgresql, and what's in its configuration (either command line or /etc/postgresql/<version>/<some_name>/*.conf)?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.