time.conf.5 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. '\" t
  2. .\" Title: time.conf
  3. .\" Author: [see the "AUTHOR" 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 "TIME\&.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. time.conf \- configuration file for the pam_time module
  32. .SH "DESCRIPTION"
  33. .PP
  34. The pam_time PAM module does not authenticate the user, but instead it restricts access to a system and or specific applications at various times of the day and on specific days or over various terminal lines\&. This module can be configured to deny access to (individual) users based on their name, the time of day, the day of week, the service they are applying for and their terminal from which they are making their request\&.
  35. .PP
  36. For this module to function correctly there must be a correctly formatted
  37. /etc/security/time\&.conf
  38. file present\&. White spaces are ignored and lines maybe extended with \*(Aq\e\*(Aq (escaped newlines)\&. Text following a \*(Aq#\*(Aq is ignored to the end of the line\&.
  39. .PP
  40. The syntax of the lines is as follows:
  41. .PP
  42. \fIservices\fR;\fIttys\fR;\fIusers\fR;\fItimes\fR
  43. .PP
  44. In words, each rule occupies a line, terminated with a newline or the beginning of a comment; a \*(Aq\fB#\fR\*(Aq\&. It contains four fields separated with semicolons, \*(Aq\fB;\fR\*(Aq\&.
  45. .PP
  46. The first field, the
  47. \fIservices\fR
  48. field, is a logic list of PAM service names that the rule applies to\&.
  49. .PP
  50. The second field, the
  51. \fItty\fR
  52. field, is a logic list of terminal names that this rule applies to\&.
  53. .PP
  54. The third field, the
  55. \fIusers\fR
  56. field, is a logic list of users or a netgroup of users to whom this rule applies\&.
  57. .PP
  58. A logic list namely means individual tokens that are optionally prefixed with \*(Aq!\*(Aq (logical not) and separated with \*(Aq&\*(Aq (logical and) and \*(Aq|\*(Aq (logical or)\&.
  59. .PP
  60. For these items the simple wildcard \*(Aq*\*(Aq may be used only once\&. With netgroups no wildcards or logic operators are allowed\&.
  61. .PP
  62. The
  63. \fItimes\fR
  64. field is used to indicate the times at which this rule applies\&. The format here is a logic list of day/time\-range entries\&. The days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday\&. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday\&. The two character combinations accepted are Mo Tu We Th Fr Sa Su Wk Wd Al, the last two being week\-end days and all 7 days of the week respectively\&. As a final example, AlFr means all days except Friday\&.
  65. .PP
  66. Each day/time\-range can be prefixed with a \*(Aq!\*(Aq to indicate "anything but"\&. The time\-range part is two 24\-hour times HHMM, separated by a hyphen, indicating the start and finish time (if the finish time is smaller than the start time it is deemed to apply on the following day)\&.
  67. .PP
  68. For a rule to be active, ALL of service+ttys+users must be satisfied by the applying process\&.
  69. .PP
  70. Note, currently there is no daemon enforcing the end of a session\&. This needs to be remedied\&.
  71. .PP
  72. Poorly formatted rules are logged as errors using
  73. \fBsyslog\fR(3)\&.
  74. .SH "EXAMPLES"
  75. .PP
  76. These are some example lines which might be specified in
  77. /etc/security/time\&.conf\&.
  78. .PP
  79. All users except for
  80. \fIroot\fR
  81. are denied access to console\-login at all times:
  82. .sp
  83. .if n \{\
  84. .RS 4
  85. .\}
  86. .nf
  87. login ; tty* & !ttyp* ; !root ; !Al0000\-2400
  88. .fi
  89. .if n \{\
  90. .RE
  91. .\}
  92. .PP
  93. Games (configured to use PAM) are only to be accessed out of working hours\&. This rule does not apply to the user
  94. \fIwaster\fR:
  95. .sp
  96. .if n \{\
  97. .RS 4
  98. .\}
  99. .nf
  100. games ; * ; !waster ; Wd0000\-2400 | Wk1800\-0800
  101. .fi
  102. .if n \{\
  103. .RE
  104. .\}
  105. .sp
  106. .SH "SEE ALSO"
  107. .PP
  108. \fBpam_time\fR(8),
  109. \fBpam.d\fR(5),
  110. \fBpam\fR(8)
  111. .SH "AUTHOR"
  112. .PP
  113. pam_time was written by Andrew G\&. Morgan <morgan@kernel\&.org>\&.