1 .\" This manpage is Copyright (C) 1996 Austin Donnelly <and1000@cam.ac.uk>,
2 .\" with additional material Copyright (c) 1995 Martin Schulze
3 .\" <joey@infodrom.north.de>
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" This manpage was made by merging two independently written manpages,
28 .\" one written by Martin Schulze (18 Oct 95), the other written by
29 .\" Austin Donnelly, (9 Jan 96).
31 .\" Thu Jan 11 12:14:41 1996 Austin Donnelly <and1000@cam.ac.uk>
32 .\" * Merged two services(5) manpages
34 .TH SERVICES 5 2020-04-11 "Linux" "Linux Programmer's Manual"
36 services \- Internet network services list
39 is a plain ASCII file providing a mapping between human-friendly textual
40 names for internet services, and their underlying assigned port
41 numbers and protocol types.
42 Every networking program should look into
43 this file to get the port number (and protocol) for its service.
44 The C library routines
46 .BR getservbyname (3),
47 .BR getservbyport (3),
51 support querying this file from programs.
53 Port numbers are assigned by the IANA (Internet Assigned Numbers
54 Authority), and their current policy is to assign both TCP and UDP
55 protocols when assigning a port number.
56 Therefore, most entries will
57 have two entries, even for TCP-only services.
59 Port numbers below 1024 (so-called "low numbered" ports) can be
60 bound to only by root (see
65 This is so clients connecting to low numbered ports can trust
66 that the service running on the port is the standard implementation,
67 and not a rogue service run by a user of the machine.
68 Well-known port numbers specified by the IANA are normally
69 located in this root-only space.
71 The presence of an entry for a service in the
73 file does not necessarily mean that the service is currently running
77 for the configuration of Internet services offered.
79 networking services are started by
81 and so won't appear in
83 In particular, news (NNTP) and mail (SMTP) servers are often
84 initialized from the system boot scripts.
92 This is usually set to
95 Each line describes one service, and is of the form:
97 \f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
102 is the friendly name the service is known by and looked up under.
103 It is case sensitive.
104 Often, the client program is named after the
108 is the port number (in decimal) to use for this service.
111 is the type of protocol to be used.
112 This field should match an entry
116 Typical values include
122 is an optional space or tab separated list of other names for this
124 Again, the names are case
127 Either spaces or tabs may be used to separate the fields.
129 Comments are started by the hash sign (#) and continue until the end
131 Blank lines are skipped.
135 should begin in the first column of the file, since leading spaces are
138 can be any printable characters excluding space and tab.
139 However, a conservative choice of characters should be used to minimize
140 compatibility problems.
141 For example, a\-z, 0\-9, and hyphen (\-) would seem a
144 Lines not matching this format should not be present in the
146 (Currently, they are silently skipped by
148 .BR getservbyname (3),
150 .BR getservbyport (3).
151 However, this behavior should not be relied on.)
153 .\" The following is not true as at glibc 2.8 (a line with a comma is
154 .\" ignored by getservent()); it's not clear if/when it was ever true.
155 .\" As a backward compatibility feature, the slash (/) between the
159 .\" name can in fact be either a slash or a comma (,).
160 .\" Use of the comma in
161 .\" modern installations is deprecated.
163 This file might be distributed over a network using a network-wide
164 naming service like Yellow Pages/NIS or BIND/Hesiod.
168 file might look like this:
174 msp 18/tcp # message send protocol
175 msp 18/udp # message send protocol
176 chargen 19/tcp ttytst source
177 chargen 19/udp ttytst source
186 The Internet network services list
192 .\" It's not clear when/if the following was ever true;
193 .\" it isn't true for glibc 2.8:
194 .\" There is a maximum of 35 aliases, due to the way the
195 .\" .BR getservent (3)
198 .\" It's not clear when/if the following was ever true;
199 .\" it isn't true for glibc 2.8:
200 .\" Lines longer than
202 .\" (currently 1024) characters will be ignored by
203 .\" .BR getservent (3),
204 .\" .BR getservbyname (3),
206 .\" .BR getservbyport (3).
207 .\" However, this will also cause the next line to be mis-parsed.
211 .BR getservbyname (3),
212 .BR getservbyport (3),
219 Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002).