Debian Codegraph @

upstream/debian-unstable/man5/hosts.equiv.5

raw
1 .\" Copyright 1995, Peter Tobias <[email protected]>
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH hosts.equiv 5 2026-02-08 "Linux man-pages 6.18"
7 .SH NAME
8 hosts.equiv \- list of hosts and users that are granted "trusted"
9 .B r
10 command access to your system
11 .SH DESCRIPTION
12 The file
13 .I /etc/hosts.equiv
14 allows or denies hosts and users to use
15 the
16 .BR r -commands
17 (e.g.,
18 .BR rlogin ,
19 .BR rsh ,
20 or
21 .BR rcp )
22 without
23 supplying a password.
24 .P
25 The file uses the following format:
26 .TP
27 .I +|[\-]hostname|+@netgroup|\-@netgroup [+|[\-]username|+@netgroup|\-@netgroup]
28 .P
29 The
30 .I hostname
31 is the name of a host which is logically equivalent
32 to the local host.
33 Users logged into that host are allowed to access
34 like-named user accounts on the local host without supplying a password.
35 The
36 .I hostname
37 may be (optionally) preceded by a plus (+) sign.
38 If the plus sign is used alone, it allows any host to access your system.
39 You can explicitly deny access to a host by preceding the
40 .I hostname
41 by a minus (\-) sign.
42 Users from that host must always supply additional credentials,
43 including possibly a password.
44 For security reasons you should always
45 use the FQDN of the hostname and not the short hostname.
46 .P
47 The
48 .I username
49 entry grants a specific user access to all user
50 accounts (except root) without supplying a password.
51 That means the
52 user is NOT restricted to like-named accounts.
53 The
54 .I username
55 may
56 be (optionally) preceded by a plus (+) sign.
57 You can also explicitly
58 deny access to a specific user by preceding the
59 .I username
60 with
61 a minus (\-) sign.
62 This says that the user is not trusted no matter
63 what other entries for that host exist.
64 .P
65 Netgroups can be specified by preceding the netgroup by an @ sign.
66 .P
67 Be extremely careful when using the plus (+) sign.
68 A simple typographical
69 error could result in a standalone plus sign.
70 A standalone plus sign is
71 a wildcard character that means "any host"!
72 .SH FILES
73 .I /etc/hosts.equiv
74 .SH NOTES
75 Some systems will honor the contents of this file only when it has owner
76 root and no write permission for anybody else.
77 Some exceptionally
78 paranoid systems even require that there be no other hard links to the file.
79 .P
80 Modern systems use the Pluggable Authentication Modules library (PAM).
81 With PAM a standalone plus sign is considered a wildcard
82 character which means "any host" only when the word
83 .I promiscuous
84 is added to the auth component line in your PAM file for
85 the particular service
86 .RB "(e.g., " rlogin ).
87 .SH EXAMPLES
88 Below are some example
89 .I /etc/host.equiv
90 or
91 .I \[ti]/.rhosts
92 files.
93 .P
94 Allow any user to log in from any host:
95 .P
96 .in +4n
97 .EX
98 +
99 .EE
100 .in
101 .P
102 Allow any user from
103 .I host
104 with a matching local account to log in:
105 .P
106 .in +4n
107 .EX
108 host
109 .EE
110 .in
111 .P
112 Note: the use of
113 .I +host
114 is never a valid syntax,
115 including attempting to specify that any user from the host is allowed.
116 .P
117 Allow any user from
118 .I host
119 to log in:
120 .P
121 .in +4n
122 .EX
123 host +
124 .EE
125 .in
126 .P
127 Note: this is distinct from the previous example
128 since it does not require a matching local account.
129 .P
130 Allow
131 .I user
132 from
133 .I host
134 to log in as any non-root user:
135 .P
136 .in +4n
137 .EX
138 host user
139 .EE
140 .in
141 .P
142 Allow all users with matching local accounts from
143 .I host
144 to log in except for
145 .IR baduser :
146 .P
147 .in +4n
148 .EX
149 host \-baduser
150 host
151 .EE
152 .in
153 .P
154 Deny all users from
155 .IR host :
156 .P
157 .in +4n
158 .EX
159 \-host
160 .EE
161 .in
162 .P
163 Note: the use of
164 .I "\-host\ \-user"
165 is never a valid syntax,
166 including attempting to specify that a particular user from the host
167 is not trusted.
168 .P
169 Allow all users with matching local accounts on all hosts in a
170 .IR netgroup :
171 .P
172 .in +4n
173 .EX
174 +@netgroup
175 .EE
176 .in
177 .P
178 Disallow all users on all hosts in a
179 .IR netgroup :
180 .P
181 .in +4n
182 .EX
183 \-@netgroup
184 .EE
185 .in
186 .P
187 Allow all users in a
188 .I netgroup
189 to log in from
190 .I host
191 as any non-root user:
192 .P
193 .in +4n
194 .EX
195 host +@netgroup
196 .EE
197 .in
198 .P
199 Allow all users with matching local accounts on all hosts in a
200 .I netgroup
201 except
202 .IR baduser :
203 .P
204 .in +4n
205 .EX
206 +@netgroup \-baduser
207 +@netgroup
208 .EE
209 .in
210 .P
211 Note: the deny statements must always precede the allow statements because
212 the file is processed sequentially until the first matching rule is found.
213 .SH SEE ALSO
214 .BR rhosts (5),
215 .BR rlogind (8),
216 .BR rshd (8)