2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" This manpage is Copyright (C) 1996 Austin Donnelly <and1000@cam.ac.uk>,
|
2008-07-08 14:32:54 +00:00
|
|
|
.\" with additional material Copyright (c) 1995 Martin Schulze
|
|
|
|
.\" <joey@infodrom.north.de>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" This manpage was made by merging two independently written manpages,
|
|
|
|
.\" one written by Martin Schulze (18 Oct 95), the other written by
|
|
|
|
.\" Austin Donnelly, (9 Jan 96).
|
|
|
|
.\"
|
|
|
|
.\" Thu Jan 11 12:14:41 1996 Austin Donnelly <and1000@cam.ac.uk>
|
|
|
|
.\" * Merged two services(5) manpages
|
|
|
|
.\"
|
2010-05-22 03:46:15 +00:00
|
|
|
.TH SERVICES 5 2010-05-22 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
services \- Internet network services list
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B services
|
2008-09-23 08:19:32 +00:00
|
|
|
is a plain ASCII file providing a mapping between human-friendly textual
|
2004-11-03 13:51:07 +00:00
|
|
|
names for internet services, and their underlying assigned port
|
2007-04-12 22:42:49 +00:00
|
|
|
numbers and protocol types.
|
|
|
|
Every networking program should look into
|
2004-11-03 13:51:07 +00:00
|
|
|
this file to get the port number (and protocol) for its service.
|
|
|
|
The C library routines
|
|
|
|
.BR getservent (3),
|
|
|
|
.BR getservbyname (3),
|
|
|
|
.BR getservbyport (3),
|
|
|
|
.BR setservent (3),
|
2007-04-12 22:42:49 +00:00
|
|
|
and
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR endservent (3)
|
|
|
|
support querying this file from programs.
|
|
|
|
|
|
|
|
Port numbers are assigned by the IANA (Internet Assigned Numbers
|
|
|
|
Authority), and their current policy is to assign both TCP and UDP
|
2007-04-12 22:42:49 +00:00
|
|
|
protocols when assigning a port number.
|
|
|
|
Therefore, most entries will
|
2008-09-23 08:19:32 +00:00
|
|
|
have two entries, even for TCP-only services.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2008-06-05 20:14:50 +00:00
|
|
|
Port numbers below 1024 (so-called "low numbered" ports) can only be
|
2004-11-03 13:51:07 +00:00
|
|
|
bound to by root (see
|
|
|
|
.BR bind (2),
|
|
|
|
.BR tcp (7),
|
2007-04-12 22:42:49 +00:00
|
|
|
and
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR udp (7)).
|
|
|
|
This is so clients connecting to low numbered ports can trust
|
|
|
|
that the service running on the port is the standard implementation,
|
2007-04-12 22:42:49 +00:00
|
|
|
and not a rogue service run by a user of the machine.
|
|
|
|
Well-known port numbers specified by the IANA are normally
|
|
|
|
located in this root-only space.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2007-04-12 22:42:49 +00:00
|
|
|
The presence of an entry for a service in the
|
2004-11-03 13:51:07 +00:00
|
|
|
.B services
|
|
|
|
file does not necessarily mean that the service is currently running
|
2007-04-12 22:42:49 +00:00
|
|
|
on the machine.
|
|
|
|
See
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR inetd.conf (5)
|
2007-04-12 22:42:49 +00:00
|
|
|
for the configuration of Internet services offered.
|
|
|
|
Note that not all
|
2004-11-03 13:51:07 +00:00
|
|
|
networking services are started by
|
|
|
|
.BR inetd (8),
|
|
|
|
and so won't appear in
|
|
|
|
.BR inetd.conf (5).
|
|
|
|
In particular, news (NNTP) and mail (SMTP) servers are often
|
|
|
|
initialized from the system boot scripts.
|
|
|
|
|
|
|
|
The location of the
|
|
|
|
.B services
|
|
|
|
file is defined by
|
|
|
|
.B _PATH_SERVICES
|
|
|
|
in
|
2007-12-10 07:16:06 +00:00
|
|
|
.IR <netdb.h> "."
|
2004-11-03 13:51:07 +00:00
|
|
|
This is usually set to
|
|
|
|
.IR /etc/services "."
|
|
|
|
|
|
|
|
Each line describes one service, and is of the form:
|
|
|
|
.IP
|
|
|
|
\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
|
|
|
|
.TP
|
|
|
|
where:
|
|
|
|
.TP 10
|
|
|
|
.I service-name
|
2007-04-12 22:42:49 +00:00
|
|
|
is the friendly name the service is known by and looked up under.
|
|
|
|
It is case sensitive.
|
|
|
|
Often, the client program is named after the
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR service-name "."
|
|
|
|
.TP
|
|
|
|
.I port
|
|
|
|
is the port number (in decimal) to use for this service.
|
|
|
|
.TP
|
|
|
|
.I protocol
|
2007-04-12 22:42:49 +00:00
|
|
|
is the type of protocol to be used.
|
|
|
|
This field should match an entry
|
2004-11-03 13:51:07 +00:00
|
|
|
in the
|
|
|
|
.BR protocols (5)
|
2007-04-12 22:42:49 +00:00
|
|
|
file.
|
|
|
|
Typical values include
|
2004-11-03 13:51:07 +00:00
|
|
|
.B tcp
|
|
|
|
and
|
|
|
|
.BR udp .
|
|
|
|
.TP
|
|
|
|
.I aliases
|
|
|
|
is an optional space or tab separated list of other names for this
|
2010-05-22 03:46:15 +00:00
|
|
|
service.
|
2007-04-12 22:42:49 +00:00
|
|
|
Again, the names are case
|
2004-11-03 13:51:07 +00:00
|
|
|
sensitive.
|
|
|
|
.PP
|
|
|
|
Either spaces or tabs may be used to separate the fields.
|
|
|
|
|
|
|
|
Comments are started by the hash sign (#) and continue until the end
|
2007-04-12 22:42:49 +00:00
|
|
|
of the line.
|
|
|
|
Blank lines are skipped.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
|
|
|
The
|
|
|
|
.I service-name
|
|
|
|
should begin in the first column of the file, since leading spaces are
|
|
|
|
not stripped.
|
|
|
|
.I service-names
|
2007-04-12 22:42:49 +00:00
|
|
|
can be any printable characters excluding space and tab.
|
|
|
|
However, a conservative choice of characters should be used to minimize
|
2007-10-08 19:56:57 +00:00
|
|
|
compatibility problems.
|
2007-04-12 22:42:49 +00:00
|
|
|
E.g., a\-z, 0\-9, and hyphen (\-) would seem a
|
2004-11-03 13:51:07 +00:00
|
|
|
sensible choice.
|
|
|
|
|
|
|
|
Lines not matching this format should not be present in the
|
2007-04-12 22:42:49 +00:00
|
|
|
file.
|
|
|
|
(Currently, they are silently skipped by
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR getservent (3),
|
|
|
|
.BR getservbyname (3),
|
|
|
|
and
|
|
|
|
.BR getservbyport (3).
|
2007-06-08 09:56:56 +00:00
|
|
|
However, this behavior should not be relied on.)
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2008-09-23 09:20:21 +00:00
|
|
|
.\" The following is not true as at glibc 2.8 (a line with a comma is
|
|
|
|
.\" ignored by getservent()); it's not clear if/when it was ever true.
|
Changes.old, clone.2, execve.2, fcntl.2, futex.2, getitimer.2, getpriority.2, mmap.2, mount.2, mprotect.2, sched_setscheduler.2, select_tut.2, setuid.2, sigaltstack.2, vfork.2, div.3, fenv.3, fmod.3, memchr.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_getattr_np.3, queue.3, scanf.3, trunc.3, st.4, proc.5, services.5, utmp.5, bootparam.7, capabilities.7, feature_test_macros.7, futex.7, glob.7, man.7, netlink.7, unicode.7: Switch to American usage: "-wards" ==> "-ward"
American English uses "afterward" in preference to "afterwards",
and so on
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-26 05:34:47 +00:00
|
|
|
.\" As a backward compatibility feature, the slash (/) between the
|
2008-09-23 09:20:21 +00:00
|
|
|
.\" .I port
|
|
|
|
.\" number and
|
|
|
|
.\" .I protocol
|
|
|
|
.\" name can in fact be either a slash or a comma (,).
|
|
|
|
.\" Use of the comma in
|
|
|
|
.\" modern installations is deprecated.
|
2008-09-23 13:51:25 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
This file might be distributed over a network using a network-wide
|
|
|
|
naming service like Yellow Pages/NIS or BIND/Hesiod.
|
|
|
|
|
|
|
|
A sample
|
|
|
|
.B services
|
|
|
|
file might look like this:
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
.sp
|
|
|
|
.ta 3i
|
|
|
|
netstat 15/tcp
|
|
|
|
qotd 17/tcp quote
|
|
|
|
msp 18/tcp # message send protocol
|
|
|
|
msp 18/udp # message send protocol
|
|
|
|
chargen 19/tcp ttytst source
|
|
|
|
chargen 19/udp ttytst source
|
|
|
|
ftp 21/tcp
|
2005-07-06 12:57:38 +00:00
|
|
|
# 22 \- unassigned
|
2004-11-03 13:51:07 +00:00
|
|
|
telnet 23/tcp
|
|
|
|
.fi
|
|
|
|
.RE
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH FILES
|
|
|
|
.TP
|
|
|
|
.I /etc/services
|
|
|
|
The Internet network services list
|
|
|
|
.TP
|
2007-12-10 07:16:06 +00:00
|
|
|
.I <netdb.h>
|
2007-05-19 04:30:20 +00:00
|
|
|
Definition of
|
|
|
|
.B _PATH_SERVICES
|
2008-09-23 08:46:24 +00:00
|
|
|
.\" .SH BUGS
|
|
|
|
.\" It's not clear when/if the following was ever true;
|
|
|
|
.\" it isn't true for glibc 2.8:
|
|
|
|
.\" There is a maximum of 35 aliases, due to the way the
|
|
|
|
.\" .BR getservent (3)
|
|
|
|
.\" code is written.
|
2008-09-23 13:51:25 +00:00
|
|
|
.\"
|
2008-09-23 08:46:24 +00:00
|
|
|
.\" It's not clear when/if the following was ever true;
|
|
|
|
.\" it isn't true for glibc 2.8:
|
|
|
|
.\" Lines longer than
|
|
|
|
.\" .B BUFSIZ
|
|
|
|
.\" (currently 1024) characters will be ignored by
|
|
|
|
.\" .BR getservent (3),
|
|
|
|
.\" .BR getservbyname (3),
|
|
|
|
.\" and
|
|
|
|
.\" .BR getservbyport (3).
|
|
|
|
.\" However, this will also cause the next line to be mis-parsed.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR listen (2),
|
|
|
|
.BR endservent (3),
|
|
|
|
.BR getservbyname (3),
|
|
|
|
.BR getservbyport (3),
|
|
|
|
.BR getservent (3),
|
|
|
|
.BR setservent (3),
|
|
|
|
.BR inetd.conf (5),
|
|
|
|
.BR protocols (5),
|
|
|
|
.BR inetd (8)
|
|
|
|
|
arch_prctl.2, fcntl.2, flock.2, get_robust_list.2, getpriority.2, ioprio_set.2, migrate_pages.2, mmap.2, mremap.2, msync.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, socket.2, subpage_prot.2, unshare.2, btree.3, dbopen.3, dl_iterate_phdr.3, dlopen.3, getnameinfo.3, hash.3, lockf.3, netlink.3, recno.3, rpc.3, xdr.3, cciss.4, console_ioctl.4, hpsa.4, initrd.4, msr.4, rtc.4, st.4, hosts.5, services.5, tzfile.5, aio.7, arp.7, capabilities.7, cpuset.7, feature_test_macros.7, futex.7, inotify.7, ip.7, ipv6.7, iso_8859-16.7, iso_8859-2.7, koi8-r.7, math_error.7, netlink.7, packet.7, pthreads.7, raw.7, spufs.7, udplite.7, uri.7, x25.7: Global fix: Various consistency fixes for SEE ALSO
Coauthored-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-09-24 07:53:22 +00:00
|
|
|
Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002).
|