LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-14-2022, 01:52 AM   #1
mxcdh
LQ Newbie
 
Registered: Apr 2022
Posts: 3

Rep: Reputation: 0
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
 
Old 04-15-2022, 12:34 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by mxcdh View Post
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)?
 
Old 04-18-2022, 09:57 AM   #3
mxcdh
LQ Newbie
 
Registered: Apr 2022
Posts: 3

Original Poster
Rep: Reputation: 0
@ondoho thanks!
 
Old 04-19-2022, 01:08 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by mxcdh View Post
@ondoho thanks!
um... ok, i guess?
Is your problem solved? If so -
Please mark your thread SOLVED (see my signature). Others will benefit.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Difference Between PostgreSQL And MySQL And How To Migrate From MySQL To PostgreSQL LXer Syndicated Linux News 0 05-27-2017 08:26 PM
LXer: The PostgreSQL Global Development Group's PostgreSQL LXer Syndicated Linux News 0 03-31-2016 07:35 PM
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
Postgresql giving connection timed out because of iptables thatishari Linux - Security 3 07-20-2011 12:23 AM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration