LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-01-2009, 09:55 PM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Rep: Reputation: 51
How can I open port?


I ran nmap on my fedora 9 system as:
Code:
[root@Innova ~]# nmap -vv localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2009-10-02 08:04 IST
Initiating SYN Stealth Scan at 08:04
Scanning localhost.localdomain (127.0.0.1) [1714 ports]
Discovered open port 80/tcp on 127.0.0.1
Discovered open port 443/tcp on 127.0.0.1
Discovered open port 22/tcp on 127.0.0.1
Discovered open port 8080/tcp on 127.0.0.1
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 111/tcp on 127.0.0.1
Discovered open port 2049/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 977/tcp on 127.0.0.1
Discovered open port 8009/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 3306/tcp on 127.0.0.1
Completed SYN Stealth Scan at 08:04, 0.08s elapsed (1714 total ports)
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1702 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
977/tcp  open  unknown
2049/tcp open  nfs
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.157 seconds
           Raw packets sent: 1714 (75.416KB) | Rcvd: 3440 (144.504KB)
I want to configure sendmail and so do I need to open port 25.
Any idea how can I open that port?
 
Old 10-01-2009, 10:54 PM   #2
Vhann
LQ Newbie
 
Registered: Nov 2008
Posts: 24

Rep: Reputation: Disabled
You do not need to open a port per say.

An open port means there is an application currently listening on the port. The fact that you don't see it opened means no application is currently using that port (which is fine since you _intend_ to use it).

Basically, just starting sendmail will actually 'open' the port.

Note though that you may need to configure your router/firewall or such in order for it to forward traffic on the given port (though this is highly improbable on port numbers under 1024).

Hope this helps, don't hesitate if you have further questions.

Regards,
Vhann
 
Old 10-01-2009, 11:01 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
Actually, that's only true if you turn off the firewall.

service iptables stop

If iptables is running, then (assuming its a sane setup) you will need to open port 25 in the firewall (iptables) as well.

See section 27.1.16 http://www.linuxtopia.org/online_boo...onfig-iptables
 
Old 10-01-2009, 11:02 PM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Sendmail is running and still it shows "25" not open.
 
Old 10-01-2009, 11:06 PM   #5
Vhann
LQ Newbie
 
Registered: Nov 2008
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by your_shadow03 View Post
Sendmail is running and still it shows "25" not open.
Try following chrism01's advice by turning off iptables (I wasn't aware iptables blocked port 25)
 
Old 10-01-2009, 11:10 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
That's what I meant by a sane setup; by default all ports are closed unless explicitly set open. See my link.

BTW, default (again security issue) for sendmail's cfg is to only listen on 127.0.0.1 ie localhost.
You have to fixup the cfg file and restart sendmail.

Modify /etc/mail/sendmail.mc to listen on all interfaces

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Restart sendmail

Last edited by chrism01; 10-01-2009 at 11:13 PM.
 
Old 10-01-2009, 11:18 PM   #7
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Firewall is stopped.
The Entry is modified.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
If I forward a port in iptables, does the port have to be open on the firewall? qwertyjjj Linux - Server 4 08-06-2009 09:22 AM
port 25 filtered despite firewall having port 25 open ille.pugil42 Linux - Security 8 03-09-2007 12:51 AM
best port scanner To scan open port in a network tanveer Linux - Security 8 01-21-2007 08:19 PM
cannot SFTP to SUSE 9.2 box, port 22 open, can putty in though using same port. jgrady Linux - Networking 6 03-29-2005 08:44 AM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration