1ACCESS.CONF(5) Linux-PAM Manual ACCESS.CONF(5)
2
3
4
6 access.conf - the login access control table file
7
9 The /etc/security/access.conf file specifies (user/group, host),
10 (user/group, network/netmask) or (user/group, tty) combinations for
11 which a login will be either accepted or refused.
12
13 When someone logs in, the file access.conf is scanned for the first
14 entry that matches the (user/group, host) or (user/group,
15 network/netmask) combination, or, in case of non-networked logins, the
16 first entry that matches the (user/group, tty) combination. The
17 permissions field of that table entry determines whether the login will
18 be accepted or refused.
19
20 Each line of the login access control table has three fields separated
21 by a ":" character (colon):
22
23 permission:users/groups:origins
24
25 The first field, the permission field, can be either a "+" character
26 (plus) for access granted or a "-" character (minus) for access denied.
27
28 The second field, the users/group field, should be a list of one or
29 more login names, group names, or ALL (which always matches). To
30 differentiate user entries from group entries, group entries should be
31 written with brackets, e.g. (group).
32
33 The third field, the origins field, should be a list of one or more tty
34 names (for non-networked logins), host names, domain names (begin with
35 "."), host addresses, internet network numbers (end with "."), internet
36 network addresses with network mask (where network mask can be a
37 decimal number or an internet address also), ALL (which always matches)
38 or LOCAL. LOCAL keyword matches if and only if the PAM_RHOST is not
39 set and <origin> field is thus set from PAM_TTY or PAM_SERVICE". If
40 supported by the system you can use @netgroupname in host or user
41 patterns. The @@netgroupname syntax is supported in the user pattern
42 only and it makes the local system hostname to be passed to the
43 netgroup match call in addition to the user name. This might not work
44 correctly on some libc implementations causing the match to always
45 fail.
46
47 The EXCEPT operator makes it possible to write very compact rules.
48
49 If the nodefgroup is not set, the group file is searched when a name
50 does not match that of the logged-in user. Only groups are matched in
51 which users are explicitly listed. However the PAM module does not look
52 at the primary group id of a user.
53
54 The "#" character at start of line (no space at front) can be used to
55 mark this line as a comment line.
56
58 These are some example lines which might be specified in
59 /etc/security/access.conf.
60
61 User root should be allowed to get access via cron, X11 terminal :0,
62 tty1, ..., tty5, tty6.
63
64 + : root : crond :0 tty1 tty2 tty3 tty4 tty5 tty6
65
66 User root should be allowed to get access from hosts which own the IPv4
67 addresses. This does not mean that the connection have to be a IPv4
68 one, a IPv6 connection from a host with one of this IPv4 addresses does
69 work, too.
70
71 + : root : 192.168.200.1 192.168.200.4 192.168.200.9
72
73 + : root : 127.0.0.1
74
75 User root should get access from network 192.168.201. where the term
76 will be evaluated by string matching. But it might be better to use
77 network/netmask instead. The same meaning of 192.168.201. is
78 192.168.201.0/24 or 192.168.201.0/255.255.255.0.
79
80 + : root : 192.168.201.
81
82 User root should be able to have access from hosts foo1.bar.org and
83 foo2.bar.org (uses string matching also).
84
85 + : root : foo1.bar.org foo2.bar.org
86
87 User root should be able to have access from domain foo.bar.org (uses
88 string matching also).
89
90 + : root : .foo.bar.org
91
92 User root should be denied to get access from all other sources.
93
94 - : root : ALL
95
96 User foo and members of netgroup admins should be allowed to get access
97 from all sources. This will only work if netgroup service is available.
98
99 + : @admins foo : ALL
100
101 User john and foo should get access from IPv6 host address.
102
103 + : john foo : 2001:db8:0:101::1
104
105 User john should get access from IPv6 net/mask.
106
107 + : john : 2001:db8:0:101::/64
108
109 Disallow console logins to all but the shutdown, sync and all other
110 accounts, which are a member of the wheel group.
111
112 -:ALL EXCEPT (wheel) shutdown sync:LOCAL
113
114 All other users should be denied to get access from all sources.
115
116 - : ALL : ALL
117
119 pam_access(8), pam.d(5), pam(8)
120
122 Original login.access(5) manual was provided by Guido van Rooij which
123 was renamed to access.conf(5) to reflect relation to default config
124 file.
125
126 Network address / netmask description and example text was introduced
127 by Mike Becher <mike.becher@lrz-muenchen.de>.
128
129
130
131Linux-PAM Manual 12/09/2009 ACCESS.CONF(5)