Skip to contentSkip to conversation

/etc/services file

DISCUSSION simon Shaw 2 participants 2 messages Dec 9, 2002

lore
Share & tools
lore

simon Shaw

author
#0 lore raw

Hi Friends,

Can you tell me what is the function of /etc/services file? I know it is
about the mapping of famous services to its ports number. But what I don't understand is that what if I miss a entry i.e. (ftp 21/tcp), it means I can't do ftp ? And sometime, when I am installing a third party software in my unix box, it required me to add some entry in my /etc/service i.e. (els_port 2101/udp, els_port 2101/tcp) What is the effect of the entry?

Q2, when I read a document about services to be filtered as shown below. How to filter the service? Deleting entry in /etc/services file or inetd.conf

<<DOCUMENT>>
Because of flaws in the protocol or chronic system administration problems, we recommend that the following services be filtered:

DNS zone transfers socket 53 (TCP)
tftpd socket 69 (UDP)
link socket 87 (TCP) (commonly used by intruders) SunRPC & NFS socket 111 and 2049 (UDP and TCP) BSD UNIX "r" cmds sockets 512, 513, and 514 (TCP) lpd socket 515 (TCP)
uucpd socket 540 (TCP)
openwindows socket 2000 (UDP and TCP)
X windows socket 6000+ (UDP and TCP

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

#1 lore raw
Quoted 7 lines · simon Shaw

Can you tell me what is the function of /etc/services file? I know it is
about the mapping of famous services to its ports number. But what I don't
understand is that what if I miss a entry i.e. (ftp 21/tcp), it means
I can't do ftp ? And sometime, when I am installing a third party
software in my unix box, it required me to add some entry in my /etc/service
i.e. (els_port 2101/udp, els_port 2101/tcp) What is the effect
of the entry?

/etc/services is typically used by getservbyname (and the other functions which are documented in the same manpage, but getservbyname is by far the most common interface).

If an entry is absent from the file, it means that the port usually cannot be referred to by the service name; however, most programs which allow the user to specify a service name allow you to specify a numeric port number instead.

Quoted 8 lines

Q2, when I read a document about services to be filtered as shown below. How to filter the service? Deleting entry in /etc/services file or inetd.conf

<<DOCUMENT>>
Because of flaws in the protocol or chronic system administration problems, we recommend that the following services be filtered:

Quoted 9 lines

DNS zone transfers socket 53 (TCP)
tftpd socket 69 (UDP)
link socket 87 (TCP) (commonly used by intruders) SunRPC & NFS socket 111 and 2049 (UDP and TCP) BSD UNIX "r" cmds sockets 512, 513, and 514 (TCP) lpd socket 515 (TCP)
uucpd socket 540 (TCP)
openwindows socket 2000 (UDP and TCP)
X windows socket 6000+ (UDP and TCP

Such recommendations normally refer to packet filtering (as performed by e.g. ipchains/iptables); typically, the filtering would be performed on the ingress router, preventing all inbound traffic to those ports on all hosts.

Removing or disabling entries in /etc/inetd.conf will help if the service is implemented via inetd (e.g. TFTP, "r" commands); it won't help otherwise (e.g. DNS, X). Removing entries from /etc/services seldom helps.

Signature · 1 line
Glynn Clements <[email protected]>