1ACCESS.CONF(5)                 Linux-PAM Manual                 ACCESS.CONF(5)
2
3
4

NAME

6       access.conf - the login access control table file
7

DESCRIPTION

9       The /etc/security/access.conf file specifies (user/group, host),
10       (user/group, network/netmask), (user/group, tty), (user/group,
11       X-$DISPLAY-value), or (user/group, pam-service-name) combinations for
12       which a login will be either accepted or refused.
13
14       When someone logs in, the file access.conf is scanned for the first
15       entry that matches the (user/group, host) or (user/group,
16       network/netmask) combination, or, in case of non-networked logins, the
17       first entry that matches the (user/group, tty) combination, or in the
18       case of non-networked logins without a tty, the first entry that
19       matches the (user/group, X-$DISPLAY-value) or (user/group,
20       pam-service-name/) combination. The permissions field of that table
21       entry determines whether the login will be accepted or refused.
22
23       Each line of the login access control table has three fields separated
24       by a ":" character (colon):
25
26       permission:users/groups:origins
27
28       The first field, the permission field, can be either a "+" character
29       (plus) for access granted or a "-" character (minus) for access denied.
30
31       The second field, the users/group field, should be a list of one or
32       more login names, group names, or ALL (which always matches). To
33       differentiate user entries from group entries, group entries should be
34       written with brackets, e.g.  (group).
35
36       The third field, the origins field, should be a list of one or more tty
37       names (for non-networked logins), X $DISPLAY values or PAM service
38       names (for non-networked logins without a tty), host names, domain
39       names (begin with "."), host addresses, internet network numbers (end
40       with "."), internet network addresses with network mask (where network
41       mask can be a decimal number or an internet address also), ALL (which
42       always matches) or LOCAL. The LOCAL keyword matches if and only if
43       pam_get_item(3), when called with an item_type of PAM_RHOST, returns
44       NULL or an empty string (and therefore the origins field is compared
45       against the return value of pam_get_item(3) called with an item_type of
46       PAM_TTY or, absent that, PAM_SERVICE).
47
48       If supported by the system you can use @netgroupname in host or user
49       patterns. The @@netgroupname syntax is supported in the user pattern
50       only and it makes the local system hostname to be passed to the
51       netgroup match call in addition to the user name. This might not work
52       correctly on some libc implementations causing the match to always
53       fail.
54
55       The EXCEPT operator makes it possible to write very compact rules.
56
57       If the nodefgroup is not set, the group file is searched when a name
58       does not match that of the logged-in user. Only groups are matched in
59       which users are explicitly listed. However the PAM module does not look
60       at the primary group id of a user.
61
62       The "#" character at start of line (no space at front) can be used to
63       mark this line as a comment line.
64

EXAMPLES

66       These are some example lines which might be specified in
67       /etc/security/access.conf.
68
69       User root should be allowed to get access via cron, X11 terminal :0,
70       tty1, ..., tty5, tty6.
71
72       +:root:crond :0 tty1 tty2 tty3 tty4 tty5 tty6
73
74       User root should be allowed to get access from hosts which own the IPv4
75       addresses. This does not mean that the connection have to be a IPv4
76       one, a IPv6 connection from a host with one of this IPv4 addresses does
77       work, too.
78
79       +:root:192.168.200.1 192.168.200.4 192.168.200.9
80
81       +:root:127.0.0.1
82
83       User root should get access from network 192.168.201.  where the term
84       will be evaluated by string matching. But it might be better to use
85       network/netmask instead. The same meaning of 192.168.201.  is
86       192.168.201.0/24 or 192.168.201.0/255.255.255.0.
87
88       +:root:192.168.201.
89
90       User root should be able to have access from hosts foo1.bar.org and
91       foo2.bar.org (uses string matching also).
92
93       +:root:foo1.bar.org foo2.bar.org
94
95       User root should be able to have access from domain foo.bar.org (uses
96       string matching also).
97
98       +:root:.foo.bar.org
99
100       User root should be denied to get access from all other sources.
101
102       -:root:ALL
103
104       User foo and members of netgroup admins should be allowed to get access
105       from all sources. This will only work if netgroup service is available.
106
107       +:@admins foo:ALL
108
109       User john and foo should get access from IPv6 host address.
110
111       +:john foo:2001:db8:0:101::1
112
113       User john should get access from IPv6 net/mask.
114
115       +:john:2001:db8:0:101::/64
116
117       Members of group wheel should be allowed to get access from all
118       sources.
119
120       +:(wheel):ALL
121
122       Disallow console logins to all but the shutdown, sync and all other
123       accounts, which are a member of the wheel group.
124
125       -:ALL EXCEPT (wheel) shutdown sync:LOCAL
126
127       All other users should be denied to get access from all sources.
128
129       -:ALL:ALL
130

NOTES

132       The default separators of list items in a field are space, ',', and
133       tabulator characters. Thus conveniently if spaces are put at the
134       beginning and the end of the fields they are ignored. However if the
135       list separator is changed with the listsep option, the spaces will
136       become part of the actual item and the line will be most probably
137       ignored. For this reason, it is not recommended to put spaces around
138       the ':' characters.
139

SEE ALSO

141       pam_access(8), pam.d(5), pam(8)
142

AUTHORS

144       Original login.access(5) manual was provided by Guido van Rooij which
145       was renamed to access.conf(5) to reflect relation to default config
146       file.
147
148       Network address / netmask description and example text was introduced
149       by Mike Becher <mike.becher@lrz-muenchen.de>.
150
151
152
153Linux-PAM Manual                  09/03/2021                    ACCESS.CONF(5)
Impressum