Port 25 is magically open

I just installed openSUSE 13.1, and I executed nmap on my local host

nmap localhost

and I found open the port 25. I have no SMTP service running, I mean, I got one, but I don’t know why, I didn’t setup any. By the way, it can only be accessed locally.

Running netstat -p doesn’t show the name of the listening application.

How can I disable the service?.

You better SHOW us in stead of only telling what you saw. Post prompt, command, output, next prompt by copy/pasting from the terminal window into a post between CODE tags.

Like this:

henk@boven:~> nmap localhost

Starting Nmap 6.01 ( http://nmap.org ) at 2014-01-12 12:45 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00041s latency).
Not shown: 992 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
25/tcp   open  smtp
80/tcp   open  http
111/tcp  open  rpcbind
631/tcp  open  ipp
873/tcp  open  rsync
2049/tcp open  nfs
3306/tcp open  mysql

Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds
henk@boven:~>

And

henk@boven:~> netstat -tulpn | grep ':25'
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   
tcp        0      0 ::1:25                  :::*                    LISTEN      -                   
henk@boven:~> su -
Wachtwoord: 
boven:~ # netstat -tulpn | grep ':25'
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2532/master         
tcp        0      0 ::1:25                  :::*                    LISTEN      2532/master         
boven:~ #

And this illustrates why we ask this. Not being root does not give you the PID and process name (as the warning states). And doing as we ask, will show if you were root or not (and other information that migh t be usefull for helpers).

$nmap localhost

Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-12 08:56 ART
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00019s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
25/tcp open  smtp

port 25 is intentionally open.

#sudo netstat -tulpn | grep ':25'
harry's password:
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1460/master         
tcp        0      0 ::1:25                  :::*                    LISTEN      1460/master

master?, what is that?. I don’t want a smtp server running.

What about starting with:

man master

On 2014-01-12 13:06, ninioArg wrote:

> master?, what is that?. I don’t want a smtp server running.

Yes, you do. >:-)


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Very informative answer indeed :sarcastic:

On 2014-01-12 15:36, hcvv wrote:
>
> robin_listas;2615316 Wrote:
>> On 2014-01-12 13:06, ninioArg wrote:
>>
>>> master?, what is that?. I don’t want a smtp server running.
>>
>> Yes, you do. >:-)

> Very informative answer indeed :sarcastic:

It is, isn’t? :slight_smile:

Well, he can ask me why. I’m waiting for that step, as a matter of fact.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Well, it’s done. The master starts a Postfix daemon. So, just remove the execution permission:

#chmod -x /etc/init.d/postfix

And if you want stop it for this session, it is not enough stopping the daemon:

#sh /etc/init.d/postfix stop

you need to kill the process :S

#kill -9 *PID*

Please, avoid trying to help people, you don’t.

Btw, you can also avoid postfix starts by editing /etc/postfix/master.cf.

Or use systemd to do it

systemctl status postfix.service
systemctl stop postfix.service
systemctl disable postfix.service

On 2014-01-13 03:36, deano ferrari wrote:
>
> ninioArg;2615467 Wrote:
>> Btw, you can also avoid postfix starts by editing
>> /etc/postfix/master.cf.
> Or use systemd to do it

Right, that’s the proper way.

However, this will break other services in the system that needs an smtp
service. But as my help is not desired, I will say nothing about that.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Well, as the OP hasn’t shared the reason for not wanting it, we can only speculate, so don’t concern yourself with it. It’ll soon become obvious if some service or cron job requires it :slight_smile: