]> git.neil.brown.name Git - portmap.git/blob - portmap.8
Only fail an 'unregister' attempt if nothing can be unregistered.
[portmap.git] / portmap.8
1 .\" Copyright (c) 1987 Sun Microsystems
2 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\"    must display the following acknowledgement:
15 .\"     This product includes software developed by the University of
16 .\"     California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"     from: @(#)portmap.8     5.3 (Berkeley) 3/16/91
34 .\"     $Id: portmap.8,v 1.2 2004/04/03 09:30:21 herbert Exp $
35 .\"
36 .Dd May 12, 2008
37 .Dt PORTMAP 8
38 .Os BSD 4.3
39 .Sh NAME
40 .Nm portmap
41 .Nd
42 .Tn DARPA
43 port to
44 .Tn RPC
45 program number mapper
46 .Sh SYNOPSIS
47 .Nm portmap
48 .Op Fl d
49 .Op Fl f
50 .Op Fl F
51 .Op Fl t Ar dir
52 .Op Fl v
53 .Op Fl V
54 .Op Fl i Ar address
55 .Op Fl l
56 .Op Fl u Ar uid
57 .Op Fl g Ar gid
58 .Sh DESCRIPTION
59 .Nm Portmap
60 is a server that converts
61 .Tn RPC
62 program numbers into
63 .Tn DARPA
64 protocol port numbers.
65 It must be running in order to make
66 .Tn RPC
67 calls.
68 .Pp
69 When an
70 .Tn RPC
71 server is started, it will tell
72 .Nm portmap
73 what port number it is listening to, and what
74 .Tn RPC
75 program numbers it is prepared to serve.
76 When a client wishes to make an
77 .Tn RPC
78 call to a given program number,
79 it will first contact
80 .Nm portmap
81 on the server machine to determine
82 the port number where
83 .Tn RPC
84 packets should be sent.
85 .Pp
86 .Nm Portmap
87 must be started before any
88 .Tn RPC
89 servers are invoked.
90 .Pp
91 Normally
92 .Nm portmap
93 forks and dissociates itself from the terminal
94 like any other daemon.
95 .Nm Portmap
96 then logs errors using
97 .Xr syslog 3 .
98 .Pp
99 .Nm Portmap
100 records all current mapping in the file
101 .Nm /var/run/portmap_mapping
102 so that if it gets killed and restarted, it can reload the mapping for
103 currently active services.
104 .Pp
105 Options available:
106 .Bl -tag -width Ds
107 .It Fl V
108 Display version number and exit.
109 .It Fl d
110 (debug) prevents
111 .Nm portmap
112 from running as a daemon,
113 and causes errors and debugging information
114 to be printed to the standard error output.
115 .It Fl f
116 (foreground) prevents
117 .Nm portmap
118 from running as a daemon,
119 and causes log messages
120 to be printed to the standard error output.
121 .It Fl F 
122 (foreground) same as -f, but logging as usual
123 .It Fl t Ar dir
124 (chroot) tell
125 .Nm portmap
126 to
127 .Xr chroot 2
128 into
129 .Ar dir .
130 .Ar dir
131 should be empty, not writeable by the daemon user, and preferably on a
132 filesystem mounted read-only, noexec, nodev, and nosuid.
133 .It Fl m Ar file
134 (mapfile) specify an alternative mapping 
135 .Ar file
136 .It Fl u Ar uid
137 .It Fl g Ar gid
138 Set the user-id and group-id of the running process to those given,
139 rather than the compiled-in defaults of DAEMON_UID/DAEMON_GID.
140 .if 'RPCUSER'' .ig
141 If neither are set, then
142 .Nm portmap
143 will look up the user
144 .Nm RPCUSER
145 and use the uid and gid of that user.
146 ..
147 .It Fl U Ar username
148 Lets 
149 .Nm portmap
150 run under this user (uid/gid) rather than compiled-in defaults of DEAMON_UID/DAEMON_GID.
151 .It Fl v
152 (verbose) run
153 .Nm portmap
154 in verbose mode.
155 .It Fl i Ar address
156 bind
157 .Nm portmap
158 to address. If you specify 127.0.0.1 it will bind to the loopback
159 interface only.
160 .It Fl l
161 bind
162 .Nm portmap
163 to the loop-back address 127.0.0.1.  This is a shorthand for
164 specifying 127.0.0.1 with -i.
165 .It Fl p Ar port
166 bind
167 .Nm portmap
168 to a non-standard port
169 .El
170
171 This
172 .Nm portmap
173 version is protected by the
174 .Nm tcp_wrapper
175 library. You have to give the clients access to
176 .Nm portmap
177 if they should be allowed to use it.
178 .if 'USE_DNS'yes' .ig
179 To allow connects from clients of the network 192.168. you could use
180 the following line in /etc/hosts.allow:
181
182 portmap: 192.168.
183
184 In order to avoid deadlocks, the
185 .Nm portmap
186 program does not attempt to look up the remote host name or user name, nor will
187 it try to match NIS netgroups. As a consequence only network number patterns
188 (or IP addresses) will work for portmap access control, do not use hostnames.
189 Notice that localhost will always be allowed access to the portmapper.
190
191 You have to use the daemon name
192 .Nm portmap
193 for the daemon name (even if the binary has a different name). For the
194 client names you can only use the keyword ALL or IP addresses (NOT
195 host or domain names).
196 ..
197 .if !'USE_DNS'yes' .ig
198 To allow connects from clients of
199 the .bar.com domain you could use the following line in /etc/hosts.allow:
200 .Pp
201 portmap: .bar.com
202 .Pp
203 You have to use the daemon name
204 .Nm portmap
205 for the daemon name (even if the binary has a different name). For the
206 client names you can use the keyword ALL, IP addresses, hostnames or domain
207 names. Using netgroup names will likely cause
208 .Nm portmap
209 to deadlock.
210 Note that localhost will always be allowed access to the portmapper.
211 ..
212 .Pp
213 For further information please have a look at the
214 .Xr tcpd 8 ,
215 .Xr hosts_allow 5
216 and
217 .Xr hosts_access 5
218 manual pages.
219 .Sh SEE ALSO
220 .Xr inetd.conf 5 ,
221 .Xr rpcinfo 8 ,
222 .Xr pmap_set 8 ,
223 .Xr pmap_dump 8 ,
224 .Xr inetd 8 ,
225 .Xr tcpd 8 ,
226 .Xr hosts_access 5 ,
227 .Xr hosts_options 5
228 .Sh HISTORY
229 The
230 .Nm
231 command appeared in
232 .Bx 4.3
233 .Sh AUTHORS
234 This
235 manual page was changed by
236 .An Anibal Monsalve Salazar
237 for the Debian Project.