| 1 |
'\" t |
| 2 |
.\" Title: access.conf |
| 3 |
.\" Author: [see the "AUTHORS" section] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/> |
| 5 |
.\" Date: 06/29/2025 |
| 6 |
.\" Manual: Linux-PAM Manual |
| 7 |
.\" Source: [FIXME: source] |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "ACCESS\&.CONF" "5" "06/29/2025" "[FIXME: source]" "Linux\-PAM Manual" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
access.conf \- the login access control table file |
| 32 |
.SH "DESCRIPTION" |
| 33 |
.PP |
| 34 |
The |
| 35 |
/etc/security/access\&.conf |
| 36 |
file specifies (\fIuser/group\fR, |
| 37 |
\fIhost\fR), (\fIuser/group\fR, |
| 38 |
\fInetwork/netmask\fR), (\fIuser/group\fR, |
| 39 |
\fItty\fR), (\fIuser/group\fR, |
| 40 |
\fIX\-$DISPLAY\-value\fR), or (\fIuser/group\fR, |
| 41 |
\fIpam\-service\-name\fR) combinations for which a login will be either accepted or refused\&. |
| 42 |
.PP |
| 43 |
When someone logs in, the file |
| 44 |
access\&.conf |
| 45 |
is scanned for the first entry that matches the (\fIuser/group\fR, |
| 46 |
\fIhost\fR) or (\fIuser/group\fR, |
| 47 |
\fInetwork/netmask\fR) combination, or, in case of non\-networked logins, the first entry that matches the (\fIuser/group\fR, |
| 48 |
\fItty\fR) combination, or in the case of non\-networked logins without a tty, the first entry that matches the (\fIuser/group\fR, |
| 49 |
\fIX\-$DISPLAY\-value\fR) or (\fIuser/group\fR, |
| 50 |
\fIpam\-service\-name/\fR) combination\&. The permissions field of that table entry determines whether the login will be accepted or refused\&. |
| 51 |
.PP |
| 52 |
Each line of the login access control table has three fields separated by a ":" character (colon): |
| 53 |
.PP |
| 54 |
\fIpermission\fR:\fIusers/groups\fR:\fIorigins\fR |
| 55 |
.PP |
| 56 |
The first field, the |
| 57 |
\fIpermission\fR |
| 58 |
field, can be either a "\fI+\fR" character (plus) for access granted or a "\fI\-\fR" character (minus) for access denied\&. |
| 59 |
.PP |
| 60 |
The second field, the |
| 61 |
\fIusers\fR/\fIgroup\fR |
| 62 |
field, should be a list of one or more login names, group names, uid, gid, or |
| 63 |
\fIALL\fR |
| 64 |
(which always matches)\&. To differentiate user entries from group entries, group entries should be written with brackets, e\&.g\&. |
| 65 |
\fI(group)\fR |
| 66 |
or |
| 67 |
\fI(gid)\fR\&. |
| 68 |
.PP |
| 69 |
The third field, the |
| 70 |
\fIorigins\fR |
| 71 |
field, should be a list of one or more tty names (for non\-networked logins), X |
| 72 |
\fI$DISPLAY\fR |
| 73 |
values or PAM service names (for non\-networked logins without a tty), host names, domain names (begin with "\&."), host addresses, internet network numbers (end with "\&."), internet network addresses with network mask (where network mask can be a decimal number or an internet address also), |
| 74 |
\fIALL\fR |
| 75 |
(which always matches) or |
| 76 |
\fILOCAL\fR\&. The |
| 77 |
\fILOCAL\fR |
| 78 |
keyword matches when the user connects without a network connection (e\&.g\&., |
| 79 |
\fIsu\fR, |
| 80 |
\fIlogin\fR)\&. A connection through the loopback device (e\&.g\&., |
| 81 |
\fBssh user@localhost\fR) is considered a network connection, and thus, the |
| 82 |
\fILOCAL\fR |
| 83 |
keyword does not match\&. |
| 84 |
.PP |
| 85 |
If supported by the system you can use |
| 86 |
\fI@netgroupname\fR |
| 87 |
in host or user patterns\&. The |
| 88 |
\fI@@netgroupname\fR |
| 89 |
syntax is supported in the user pattern only and it makes the local system hostname to be passed to the netgroup match call in addition to the user name\&. This might not work correctly on some libc implementations causing the match to always fail\&. |
| 90 |
.PP |
| 91 |
The |
| 92 |
\fIEXCEPT\fR |
| 93 |
operator makes it possible to write very compact rules\&. |
| 94 |
.PP |
| 95 |
If the |
| 96 |
\fBnodefgroup\fR |
| 97 |
is not set, the group file is searched when a name does not match that of the logged\-in user\&. Only groups are matched in which users are explicitly listed\&. However the PAM module does not look at the primary group id of a user\&. |
| 98 |
.PP |
| 99 |
The "\fI#\fR" character at start of line (no space at front) can be used to mark this line as a comment line\&. |
| 100 |
.SH "EXAMPLES" |
| 101 |
.PP |
| 102 |
These are some example lines which might be specified in |
| 103 |
/etc/security/access\&.conf\&. |
| 104 |
.PP |
| 105 |
User |
| 106 |
\fIroot\fR |
| 107 |
should be allowed to get access via |
| 108 |
\fIcron\fR, X11 terminal |
| 109 |
\fI:0\fR, |
| 110 |
\fItty1\fR, \&.\&.\&., |
| 111 |
\fItty5\fR, |
| 112 |
\fItty6\fR\&. |
| 113 |
.PP |
| 114 |
+:root:crond :0 tty1 tty2 tty3 tty4 tty5 tty6 |
| 115 |
.PP |
| 116 |
User |
| 117 |
\fIroot\fR |
| 118 |
should be allowed to get access from hosts which own the IPv4 addresses\&. This does not mean that the connection have to be a IPv4 one, a IPv6 connection from a host with one of this IPv4 addresses does work, too\&. |
| 119 |
.PP |
| 120 |
+:root:192\&.168\&.200\&.1 192\&.168\&.200\&.4 192\&.168\&.200\&.9 |
| 121 |
.PP |
| 122 |
+:root:127\&.0\&.0\&.1 |
| 123 |
.PP |
| 124 |
User |
| 125 |
\fIroot\fR |
| 126 |
should get access from network |
| 127 |
192\&.168\&.201\&. |
| 128 |
where the term will be evaluated by string matching\&. But it might be better to use network/netmask instead\&. The same meaning of |
| 129 |
192\&.168\&.201\&. |
| 130 |
is |
| 131 |
\fI192\&.168\&.201\&.0/24\fR |
| 132 |
or |
| 133 |
\fI192\&.168\&.201\&.0/255\&.255\&.255\&.0\fR\&. |
| 134 |
.PP |
| 135 |
+:root:192\&.168\&.201\&. |
| 136 |
.PP |
| 137 |
User |
| 138 |
\fIroot\fR |
| 139 |
should be able to have access from hosts |
| 140 |
\fIfoo1\&.bar\&.org\fR |
| 141 |
and |
| 142 |
\fIfoo2\&.bar\&.org\fR |
| 143 |
(uses string matching also)\&. |
| 144 |
.PP |
| 145 |
+:root:foo1\&.bar\&.org foo2\&.bar\&.org |
| 146 |
.PP |
| 147 |
User |
| 148 |
\fIroot\fR |
| 149 |
should be able to have access from domain |
| 150 |
\fIfoo\&.bar\&.org\fR |
| 151 |
(uses string matching also)\&. |
| 152 |
.PP |
| 153 |
+:root:\&.foo\&.bar\&.org |
| 154 |
.PP |
| 155 |
User |
| 156 |
\fIroot\fR |
| 157 |
should be denied to get access from all other sources\&. |
| 158 |
.PP |
| 159 |
\-:root:ALL |
| 160 |
.PP |
| 161 |
A user with uid |
| 162 |
\fI1003\fR |
| 163 |
and a group with gid |
| 164 |
\fI1000\fR |
| 165 |
should be allowed to get access from all other sources\&. |
| 166 |
.PP |
| 167 |
+:(1000) 1003:ALL |
| 168 |
.PP |
| 169 |
User |
| 170 |
\fIfoo\fR |
| 171 |
and members of netgroup |
| 172 |
\fIadmins\fR |
| 173 |
should be allowed to get access from all sources\&. This will only work if netgroup service is available\&. |
| 174 |
.PP |
| 175 |
+:@admins foo:ALL |
| 176 |
.PP |
| 177 |
User |
| 178 |
\fIjohn\fR |
| 179 |
and |
| 180 |
\fIfoo\fR |
| 181 |
should get access from IPv6 host address\&. |
| 182 |
.PP |
| 183 |
+:john foo:2001:db8:0:101::1 |
| 184 |
.PP |
| 185 |
User |
| 186 |
\fIjohn\fR |
| 187 |
and |
| 188 |
\fIfoo\fR |
| 189 |
should get access from IPv6 link local host address\&. |
| 190 |
.PP |
| 191 |
+:john foo:fe80::de95:818c:1b55:7e42%eth1 |
| 192 |
.PP |
| 193 |
User |
| 194 |
\fIjohn\fR |
| 195 |
should get access from IPv6 net/mask\&. |
| 196 |
.PP |
| 197 |
+:john:2001:db8:0:101::/64 |
| 198 |
.PP |
| 199 |
Members of group |
| 200 |
\fIwheel\fR |
| 201 |
should be allowed to get access from all sources\&. |
| 202 |
.PP |
| 203 |
+:(wheel):ALL |
| 204 |
.PP |
| 205 |
Disallow console logins to all but the shutdown, sync and all other accounts, which are a member of the wheel group\&. |
| 206 |
.PP |
| 207 |
\-:ALL EXCEPT (wheel) shutdown sync:LOCAL |
| 208 |
.PP |
| 209 |
All other users should be denied to get access from all sources\&. |
| 210 |
.PP |
| 211 |
\-:ALL:ALL |
| 212 |
.SH "NOTES" |
| 213 |
.PP |
| 214 |
The default separators of list items in a field are space, \*(Aq,\*(Aq, and tabulator characters\&. Thus conveniently if spaces are put at the beginning and the end of the fields they are ignored\&. However if the list separator is changed with the |
| 215 |
\fIlistsep\fR |
| 216 |
option, the spaces will become part of the actual item and the line will be most probably ignored\&. For this reason, it is not recommended to put spaces around the \*(Aq:\*(Aq characters\&. |
| 217 |
.PP |
| 218 |
An IPv6 link local host address must contain the interface identifier\&. IPv6 link local network/netmask is not supported\&. |
| 219 |
.PP |
| 220 |
Hostnames should be written as Fully\-Qualified Host Name (FQHN) to avoid confusion with device names or PAM service names\&. |
| 221 |
.SH "SEE ALSO" |
| 222 |
.PP |
| 223 |
\fBpam_access\fR(8), |
| 224 |
\fBpam.d\fR(5), |
| 225 |
\fBpam\fR(7) |
| 226 |
.SH "AUTHORS" |
| 227 |
.PP |
| 228 |
Original |
| 229 |
\fBlogin.access\fR(5) |
| 230 |
manual was provided by Guido van Rooij which was renamed to |
| 231 |
\fBaccess.conf\fR(5) |
| 232 |
to reflect relation to default config file\&. |
| 233 |
.PP |
| 234 |
Network address / netmask description and example text was introduced by Mike Becher <mike\&.becher@lrz\-muenchen\&.de>\&. |