1827283 Members
3646 Online
109717 Solutions
New Discussion

/etc/services

 
SOLVED
Go to solution
j773303
Super Advisor

/etc/services

Any command should be run after modified /etc/services?
Hero
8 REPLIES 8
Michael Tully
Honored Contributor
Solution

Re: /etc/services

Simple answer is no. The /etc/services file is used as a reference for the port numbers and their aliases.

# man services

Anyone for a Mutiny ?
j773303
Super Advisor

Re: /etc/services

But if I disable
#TCP 25 SMTP

Does this disable port 25 immediately?
Hero
Michael Steele_2
Honored Contributor

Re: /etc/services

As long as there is no conflict with other applications and its not own by root, (* < 1024 *) then you shouldn't have a problem. Order your /etc/services file with sort a check for duplicates:

cat /etc/services | sort -n | more

Don't confuse this with starting the network utility like oracle's listener or one of the inetd utilities. When you make a port you reserve buffer space and allow the system to create a system file for parsing. That's why ports are analyzed with lsof, the list open files command.

lsof -i tcp:23
lsof -i udp:123, etc.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: /etc/services

Regarding: "...But if I disable #TCP 25 SMTP Does this disable port 25 immediately? ..."

Probably not. You've got to stop the application. Run:

lsof -i smtp:25

Is there a sendmail daemon perhaps?

killsm
Support Fatherhood - Stop Family Law
Bill Hassell
Honored Contributor

Re: /etc/services

Think of /etc/services as a documentation file. A port may be used even though it is not defined in /etc/services. The file /etc/inetd.conf is used to associate a service with a daemon and route appropriate packets to the listed daemons. However, sendmail is not managed by inetd. To stop sendmail (the typical program that handles port 25), use the command:

/sbin/init.d/sendmail stop

Sendmail will no longer run and port 25 will be unused and will not respond to probes. To keep sendmail from running upon a reboot, edit the config file:

/etc/rc.config.d/mailservs

and change this line to read:

export SENDMAIL_SERVER=0

That will keep sendmail from running.


Bill Hassell, sysadmin
Michael Steele_2
Honored Contributor

Re: /etc/services

Now j773303, don't you think that 'killsm' is a lot easier to use than '/sbin/init.d/sendmail stop?'
Support Fatherhood - Stop Family Law
Michael Tully
Honored Contributor

Re: /etc/services

The man pages (killsm) also states

"HP recommends that system administrators use ``/sbin/init.d/sendmail start'' and ``/sbin/init.d/sendmail stop'' to start and stop sendmail;"
Anyone for a Mutiny ?
Steven E. Protter
Exalted Contributor

Re: /etc/services

I think of /etc/services as a documentation or reservation file.

If you comment out the port 25 reference you have no functional effect.

You can control stmp traffic by making changes to the sendmail.mc file, generating a new sendmail.cf file and block incoming mail traffic on any port or IP address.

If you want to block traffic further, you need to have some kind of firewall between your box and your users. HP has a free one, or you can have an external pc based firewall.

I refer to /etc/services as a reservation file because when you install oracle on a system it takes up several ports. Oracle doesn't bother adding entries to the /etc/services file and everything works great.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com