access.conf.5 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. '\" t
  2. .\" Title: access.conf
  3. .\" Author: [see the "AUTHORS" section]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 09/03/2021
  6. .\" Manual: Linux-PAM Manual
  7. .\" Source: Linux-PAM Manual
  8. .\" Language: English
  9. .\"
  10. .TH "ACCESS\&.CONF" "5" "09/03/2021" "Linux-PAM Manual" "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, 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. .PP
  67. The third field, the
  68. \fIorigins\fR
  69. field, should be a list of one or more tty names (for non\-networked logins), X
  70. \fI$DISPLAY\fR
  71. 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),
  72. \fIALL\fR
  73. (which always matches) or
  74. \fILOCAL\fR\&. The
  75. \fILOCAL\fR
  76. keyword matches if and only if
  77. \fBpam_get_item\fR(3), when called with an
  78. \fIitem_type\fR
  79. of
  80. \fIPAM_RHOST\fR, returns
  81. NULL
  82. or an empty string (and therefore the
  83. \fIorigins\fR
  84. field is compared against the return value of
  85. \fBpam_get_item\fR(3)
  86. called with an
  87. \fIitem_type\fR
  88. of
  89. \fIPAM_TTY\fR
  90. or, absent that,
  91. \fIPAM_SERVICE\fR)\&.
  92. .PP
  93. If supported by the system you can use
  94. \fI@netgroupname\fR
  95. in host or user patterns\&. The
  96. \fI@@netgroupname\fR
  97. 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\&.
  98. .PP
  99. The
  100. \fIEXCEPT\fR
  101. operator makes it possible to write very compact rules\&.
  102. .PP
  103. If the
  104. \fBnodefgroup\fR
  105. 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\&.
  106. .PP
  107. The "\fI#\fR" character at start of line (no space at front) can be used to mark this line as a comment line\&.
  108. .SH "EXAMPLES"
  109. .PP
  110. These are some example lines which might be specified in
  111. /etc/security/access\&.conf\&.
  112. .PP
  113. User
  114. \fIroot\fR
  115. should be allowed to get access via
  116. \fIcron\fR, X11 terminal
  117. \fI:0\fR,
  118. \fItty1\fR, \&.\&.\&.,
  119. \fItty5\fR,
  120. \fItty6\fR\&.
  121. .PP
  122. +:root:crond :0 tty1 tty2 tty3 tty4 tty5 tty6
  123. .PP
  124. User
  125. \fIroot\fR
  126. 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\&.
  127. .PP
  128. +:root:192\&.168\&.200\&.1 192\&.168\&.200\&.4 192\&.168\&.200\&.9
  129. .PP
  130. +:root:127\&.0\&.0\&.1
  131. .PP
  132. User
  133. \fIroot\fR
  134. should get access from network
  135. 192\&.168\&.201\&.
  136. where the term will be evaluated by string matching\&. But it might be better to use network/netmask instead\&. The same meaning of
  137. 192\&.168\&.201\&.
  138. is
  139. \fI192\&.168\&.201\&.0/24\fR
  140. or
  141. \fI192\&.168\&.201\&.0/255\&.255\&.255\&.0\fR\&.
  142. .PP
  143. +:root:192\&.168\&.201\&.
  144. .PP
  145. User
  146. \fIroot\fR
  147. should be able to have access from hosts
  148. \fIfoo1\&.bar\&.org\fR
  149. and
  150. \fIfoo2\&.bar\&.org\fR
  151. (uses string matching also)\&.
  152. .PP
  153. +:root:foo1\&.bar\&.org foo2\&.bar\&.org
  154. .PP
  155. User
  156. \fIroot\fR
  157. should be able to have access from domain
  158. \fIfoo\&.bar\&.org\fR
  159. (uses string matching also)\&.
  160. .PP
  161. +:root:\&.foo\&.bar\&.org
  162. .PP
  163. User
  164. \fIroot\fR
  165. should be denied to get access from all other sources\&.
  166. .PP
  167. \-:root: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. should get access from IPv6 net/mask\&.
  188. .PP
  189. +:john:2001:db8:0:101::/64
  190. .PP
  191. Members of group
  192. \fIwheel\fR
  193. should be allowed to get access from all sources\&.
  194. .PP
  195. +:(wheel):ALL
  196. .PP
  197. Disallow console logins to all but the shutdown, sync and all other accounts, which are a member of the wheel group\&.
  198. .PP
  199. \-:ALL EXCEPT (wheel) shutdown sync:LOCAL
  200. .PP
  201. All other users should be denied to get access from all sources\&.
  202. .PP
  203. \-:ALL:ALL
  204. .SH "NOTES"
  205. .PP
  206. 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
  207. \fIlistsep\fR
  208. 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\&.
  209. .SH "SEE ALSO"
  210. .PP
  211. \fBpam_access\fR(8),
  212. \fBpam.d\fR(5),
  213. \fBpam\fR(8)
  214. .SH "AUTHORS"
  215. .PP
  216. Original
  217. \fBlogin.access\fR(5)
  218. manual was provided by Guido van Rooij which was renamed to
  219. \fBaccess.conf\fR(5)
  220. to reflect relation to default config file\&.
  221. .PP
  222. Network address / netmask description and example text was introduced by Mike Becher <mike\&.becher@lrz\-muenchen\&.de>\&.