LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-06-2021, 07:50 AM   #1
linksm
LQ Newbie
 
Registered: Aug 2020
Posts: 5

Rep: Reputation: Disabled
Open port on Debian 9


Hello. Please tell me - how to open a port in debian 9, for example, 25th. And then there are so many benefits that simply contradict each other and there is nothing clear and intelligible
 
Old 03-06-2021, 07:54 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
As far as I know, Debian doesn't close ports by default. How do you know it's closed?

Generally, you use a firewall to close and open ports, such as ufw. You can also use the iptables command.

I don't know what you mean by benefits that contradict each other, and what is not clear and intelligible.
 
Old 03-06-2021, 07:59 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,685

Rep: Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714
Unless you are running a firewall, the only requirement to open a port is that you have an application running to service that port with enough authority to request the port access.
Port 25 is used for SMTP, so if you start a mail server that listens on all interfaces you will then see that port 25 is open.

If you DO run a firewall, you need also use a command to open the firewall for that port traffic. What that command would look like depends upon what firewall you are running.

PS: if you are behind a NAT interface or an edge security device to protect your network from the wild, there are also routing issues to get internet mail traffic inside and to your server. Those are managed at that edge device, and not on the local (internal) server and would be an entirely different topic.

Last edited by wpeckham; 03-06-2021 at 08:01 AM.
 
Old 03-06-2021, 09:11 AM   #4
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by wpeckham View Post
Unless you are running a firewall, the only requirement to open a port is that you have an application running to service that port with enough authority to request the port access.
Port 25 is used for SMTP, so if you start a mail server that listens on all interfaces you will then see that port 25 is open.

If you DO run a firewall, you need also use a command to open the firewall for that port traffic. What that command would look like depends upon what firewall you are running.

PS: if you are behind a NAT interface or an edge security device to protect your network from the wild, there are also routing issues to get internet mail traffic inside and to your server. Those are managed at that edge device, and not on the local (internal) server and would be an entirely different topic.
You left out many ISPs block that port 25 so the clueless who run a mail server at home do not get owned and become spam bots. Then add in all the mail servers around the world that will refuse to even connect to it when discovery from them turns up none of the requirements for sending mail on the modern internet. It is no longer a setup and send mail, you need the proper configurations in place for the verification's or they refuse to connect to some random mail server on the net.
 
Old 03-19-2021, 04:30 PM   #5
linksm
LQ Newbie
 
Registered: Aug 2020
Posts: 5

Original Poster
Rep: Reputation: Disabled
So, I am describing the situation in more detail. There is a server on Debian 9, on it you need to organize virtual hosts \ subdomains, which will each be tied to its own IP, from which mailings will go. I did it through Postfix instances, prescribing through main.cf and master.cf. As a result, everything works on the main host, but two virtuals do not work - port 25 and the rest are closed for them. I registered everything that is possible in iptables - complete zero. If I write in the main main.cf, forcibly: smtp_bind_address = Х.Х.Х.Х smtp_helo_name = mail1.new.com myhostname = mail1.new.com Then only then the port is somehow opened for him and the mailing is going on. But they don't work together, only separately. The virtual hosts themselves do not open through the browser, ERR Connection Timed Out, the main site opens itself.
 
  


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
[SOLVED] IPtables : ssh port forwarding one port to another port issue routers Linux - Networking 7 08-07-2018 08:41 AM
Four-port KVM switch that sends keyboard data to PS2 port and mouse data to USB port Ulysses_ Linux - Hardware 5 06-20-2015 11:16 AM
[SOLVED] iptables port forward not working for port range mapping to anohter Port range in Linux 2.6.39 kinghong66 Linux - Networking 2 06-17-2015 07:17 PM
Tomcat6 stops listening on port 80 when i change from port 8080 to port 80 trongthect Linux - Server 1 07-27-2012 05:41 PM
--destination-ports port[,port[,port...]] KevinGuy Linux - Networking 1 03-16-2004 06:06 PM

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

All times are GMT -5. The time now is 03:54 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