nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man4 / hosts.equiv.4
blob81679a1aa8f722c5bca7fc50c7493fc56290ef59
1 '\" te
2 .\" Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH HOSTS.EQUIV 4 "Nov 26, 2017"
8 .SH NAME
9 hosts.equiv, rhosts \- trusted remote hosts and users
10 .SH DESCRIPTION
11 .LP
12 The \fB/etc/hosts.equiv\fR and \fB\&.rhosts\fR files provide the "remote
13 authentication" database for \fBrlogin\fR(1), \fBrsh\fR(1), \fBrcp\fR(1), and
14 \fBrcmd\fR(3SOCKET). The files specify remote hosts and users that are
15 considered  "trusted". Trusted users are allowed to access the local system
16 without supplying a password. The library routine \fBruserok()\fR (see
17 \fBrcmd\fR(3SOCKET)) performs the authentication procedure for programs by
18 using the \fB/etc/hosts.equiv\fR and \fB\&.rhosts\fR files. The
19 \fB/etc/hosts.equiv\fR file applies to the entire system, while individual
20 users can maintain their own \fB\&.rhosts\fR files in their home directories.
21 .sp
22 .LP
23 These files bypass the standard password-based user authentication mechanism.
24 To maintain system security, care must be taken in creating and maintaining
25 these files.
26 .sp
27 .LP
28 The remote authentication procedure determines whether a user from a remote
29 host should be allowed to access the local system with the identity of a local
30 user. This procedure first checks the \fB/etc/hosts.equiv\fR file and then
31 checks the \fB\&.rhosts\fR file in the home directory of the local user who is
32 requesting access. Entries in these files can be of two forms. Positive entries
33 allow access, while  negative entries deny access. The authentication succeeds
34 when a matching positive entry is found. The procedure fails when the first
35 matching negative entry is found, or if no matching entries are found in either
36 file. The order of entries is important. If the files contain both positive and
37 negative entries, the entry that appears first will prevail. The \fBrsh\fR(1)
38 and \fBrcp\fR(1) programs fail if the remote authentication procedure fails.
39 The \fBrlogin\fR program falls back to the standard password-based login
40 procedure if the remote authentication fails.
41 .sp
42 .LP
43 Both files are formatted as a list of one-line entries.  Each entry has the
44 form:
45 .sp
46 .in +2
47 .nf
48 \fIhostname\fR [\fIusername\fR]
49 .fi
50 .in -2
51 .sp
53 .sp
54 .LP
55 Hostnames must be the official name of the host, not one of its nicknames.
56 .sp
57 .LP
58 Negative entries are differentiated from positive entries by a `\(mi' character
59 preceding either the  \fIhostname\fR or \fIusername\fR field.
60 .SS "Positive Entries"
61 .LP
62 If the form:
63 .sp
64 .in +2
65 .nf
66 \fIhostname\fR
67 .fi
68 .in -2
69 .sp
71 .sp
72 .LP
73 is used, then users from the named host are trusted. That is, they may access
74 the system with the same user name as they have on the remote system. This form
75 may be used in both the  \fB/etc/hosts.equiv\fR and \fB\&.rhosts\fR files.
76 .sp
77 .LP
78 If the line is in the form:
79 .sp
80 .in +2
81 .nf
82 \fIhostname\fR \fIusername\fR
83 .fi
84 .in -2
85 .sp
87 .sp
88 .LP
89 then the named user from the named host can access the system. This form may be
90 used in individual \fB\&.rhosts\fR files to allow  remote users to access the
91 system \fIas a different local user\fR. If this form is used in the
92 \fB/etc/hosts.equiv\fR file, the named remote user will be allowed to access
93 the system as  \fBany\fR local user.
94 .sp
95 .LP
96 \fBnetgroup\fR(4) can be used in either the  \fIhostname\fR or \fIusername\fR
97 fields to match a number of hosts or users in one entry. The form:
98 .sp
99 .in +2
101 \fB+@\fR\fInetgroup\fR
103 .in -2
108 allows access from all hosts in the named netgroup. When used in the
109 \fIusername\fR field, netgroups allow a group of remote users to access the
110 system as a particular local user.  The form:
112 .in +2
114 \fIhostname\fR \fB+@\fR\fInetgroup\fR
116 .in -2
121 allows all of the users in the named netgroup from the named host to access the
122 system as the local user. The form:
124 .in +2
126 \fB+@\fR\fInetgroup1\fR \fB+@\fR\fInetgroup2\fR
128 .in -2
133 allows the users in \fInetgroup2\fR from the hosts in \fInetgroup1\fR to access
134 the system as the local user.
137 The special character `+' can be used in place of either \fIhostname\fR or
138 \fIusername\fR to match any host or user. For example, the entry
140 .in +2
142 \fB+\fR
144 .in -2
149 will allow a user from any remote host to access the system with the same
150 username. The entry
152 .in +2
154 \fB+\fR \fIusername\fR
156 .in -2
161 will allow the named user from any remote host to access the system. The entry
163 .in +2
165 \fIhostname\fR \fB+\fR
167 .in -2
172 will allow any user from the named host to access the system as the local user.
173 .SS "Negative Entries"
175 Negative entries are preceded by a `\(mi' sign. The form:
177 .in +2
179 \fB\(mi\fR\fIhostname\fR
181 .in -2
186 will disallow all access from the named host. The form:
188 .in +2
190 \fB\(mi@\fR\fInetgroup\fR
192 .in -2
197 means that access is explicitly disallowed from all hosts in the named
198 netgroup. The form:
200 .in +2
202 \fIhostname\fR \fB\(mi\fR\fIusername\fR
204 .in -2
209 disallows access by the named user only from the named host, while the form:
211 .in +2
213 \fB+ \(mi@\fR\fInetgroup\fR
215 .in -2
220 will disallow access by all of the users in the named netgroup from all hosts.
221 .SS "Search Sequence"
223 To help maintain system security, the \fB/etc/hosts.equiv\fR file is not
224 checked when access is being attempted for super-user. If the user attempting
225 access is not the super-user, \fB/etc/hosts.equiv\fR is searched for lines of
226 the form described above. Checks are made for lines in this file in the
227 following order:
228 .RS +4
231 \fB+\fR
233 .RS +4
236 \fB+@\fR\fInetgroup\fR
238 .RS +4
241 \fB\(mi@\fR\fInetgroup\fR
243 .RS +4
246 \fB\(mi\fR\fIhostname\fR
248 .RS +4
251 \fIhostname\fR
255 The user is granted access if a positive match occurs.  Negative entries apply
256 only to \fB/etc/hosts.equiv\fR and may be overridden by subsequent
257 \fB\&.rhosts\fR entries.
260 If no positive match occurred, the \fB\&.rhosts\fR file is then searched if the
261 user attempting access maintains such a file. This file is searched whether or
262 not the user attempting access is the super-user. As a security feature, the
263 \fB\&.rhosts\fR file must be owned by the user who is attempting access. Checks
264 are made for lines in \fB\&.rhosts\fR in the following order:
265 .RS +4
268 \fB+\fR
270 .RS +4
273 \fB+@\fR\fInetgroup\fR
275 .RS +4
278 \fB\(mi@\fR\fInetgroup\fR
280 .RS +4
283 \fB\(mi\fR\fIhostname\fR
285 .RS +4
288 \fIhostname\fR
290 .SH FILES
291 .ne 2
293 \fB\fB/etc/hosts.equiv\fR\fR
295 .RS 20n
296 system trusted hosts and users
300 .ne 2
302 \fB\fB~/.rhosts\fR\fR
304 .RS 20n
305 user's trusted hosts and users
308 .SH SEE ALSO
310 \fBrcp\fR(1), \fBrlogin\fR(1), \fBrsh\fR(1), \fBrcmd\fR(3SOCKET),
311 \fBhosts\fR(4), \fBnetgroup\fR(4), \fBpasswd\fR(4)
312 .SH WARNINGS
314 Positive entries in \fB/etc/hosts.equiv\fR that include a \fIusername\fR field
315 (either an individual named user, a netgroup, or `\fB+\fR' sign)  should be
316 used with extreme caution. Because  \fB/etc/hosts.equiv\fR applies system-wide,
317 these entries  allow one, or a group of, remote users to access the system
318 \fBas any local user\fR. This can be a security hole. For example, because of
319 the search sequence, an \fB/etc/hosts.equiv\fR file consisting of the entries
321 .in +2
323 \fB+
324 \(mihostxxx\fR
326 .in -2
331 will not deny access to "hostxxx".