pam_motd.8 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. '\" t
  2. .\" Title: pam_motd
  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 "PAM_MOTD" "8" "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. pam_motd \- Display the motd file
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_motd\&.so\fR\ 'u
  34. \fBpam_motd\&.so\fR [motd=\fI/path/filename\fR] [motd_dir=\fI/path/dirname\&.d\fR]
  35. .SH "DESCRIPTION"
  36. .PP
  37. pam_motd is a PAM module that can be used to display arbitrary motd (message of the day) files after a successful login\&. By default, pam_motd shows files in the following locations:
  38. .PP
  39. .RS 4
  40. /etc/motd
  41. .RE
  42. .RS 4
  43. /run/motd
  44. .RE
  45. .RS 4
  46. /usr/lib/motd
  47. .RE
  48. .RS 4
  49. /etc/motd\&.d/
  50. .RE
  51. .RS 4
  52. /run/motd\&.d/
  53. .RE
  54. .RS 4
  55. /usr/lib/motd\&.d/
  56. .RE
  57. .PP
  58. Each message size is limited to 64KB\&.
  59. .PP
  60. If
  61. /etc/motd
  62. does not exist, then
  63. /run/motd
  64. is shown\&. If
  65. /run/motd
  66. does not exist, then
  67. /usr/lib/motd
  68. is shown\&.
  69. .PP
  70. Similar overriding behavior applies to the directories\&. Files in
  71. /etc/motd\&.d/
  72. override files with the same name in
  73. /run/motd\&.d/
  74. and
  75. /usr/lib/motd\&.d/\&. Files in
  76. /run/motd\&.d/
  77. override files with the same name in
  78. /usr/lib/motd\&.d/\&.
  79. .PP
  80. Files in the directories listed above are displayed in lexicographic order by name\&. Moreover, the files are filtered by reading them with the credentials of the target user authenticating on the system\&.
  81. .PP
  82. To silence a message, a symbolic link with target
  83. /dev/null
  84. may be placed in
  85. /etc/motd\&.d
  86. with the same filename as the message to be silenced\&. Example: Creating a symbolic link as follows silences
  87. /usr/lib/motd\&.d/my_motd\&.
  88. .PP
  89. \fBln \-s /dev/null /etc/motd\&.d/my_motd\fR
  90. .PP
  91. The
  92. \fBMOTD_SHOWN=pam\fR
  93. environment variable is set after showing the motd files, even when all of them were silenced using symbolic links\&.
  94. .SH "OPTIONS"
  95. .PP
  96. \fBmotd=\fR\fB\fI/path/filename\fR\fR
  97. .RS 4
  98. The
  99. /path/filename
  100. file is displayed as message of the day\&. Multiple paths to try can be specified as a colon\-separated list\&. By default this option is set to
  101. /etc/motd:/run/motd:/usr/lib/motd\&.
  102. .RE
  103. .PP
  104. \fBmotd_dir=\fR\fB\fI/path/dirname\&.d\fR\fR
  105. .RS 4
  106. The
  107. /path/dirname\&.d
  108. directory is scanned and each file contained inside of it is displayed\&. Multiple directories to scan can be specified as a colon\-separated list\&. By default this option is set to
  109. /etc/motd\&.d:/run/motd\&.d:/usr/lib/motd\&.d\&.
  110. .RE
  111. .PP
  112. When no options are given, the default behavior applies for both options\&. Specifying either option (or both) will disable the default behavior for both options\&.
  113. .SH "MODULE TYPES PROVIDED"
  114. .PP
  115. Only the
  116. \fBsession\fR
  117. module type is provided\&.
  118. .SH "RETURN VALUES"
  119. .PP
  120. PAM_ABORT
  121. .RS 4
  122. Not all relevant data or options could be obtained\&.
  123. .RE
  124. .PP
  125. PAM_BUF_ERR
  126. .RS 4
  127. Memory buffer error\&.
  128. .RE
  129. .PP
  130. PAM_IGNORE
  131. .RS 4
  132. This is the default return value of this module\&.
  133. .RE
  134. .SH "EXAMPLES"
  135. .PP
  136. The suggested usage for
  137. /etc/pam\&.d/login
  138. is:
  139. .sp
  140. .if n \{\
  141. .RS 4
  142. .\}
  143. .nf
  144. session optional pam_motd\&.so
  145. .fi
  146. .if n \{\
  147. .RE
  148. .\}
  149. .PP
  150. To use a
  151. motd
  152. file from a different location:
  153. .sp
  154. .if n \{\
  155. .RS 4
  156. .\}
  157. .nf
  158. session optional pam_motd\&.so motd=/elsewhere/motd
  159. .fi
  160. .if n \{\
  161. .RE
  162. .\}
  163. .PP
  164. To use a
  165. motd
  166. file from elsewhere, along with a corresponding
  167. \&.d
  168. directory:
  169. .sp
  170. .if n \{\
  171. .RS 4
  172. .\}
  173. .nf
  174. session optional pam_motd\&.so motd=/elsewhere/motd motd_dir=/elsewhere/motd\&.d
  175. .fi
  176. .if n \{\
  177. .RE
  178. .\}
  179. .sp
  180. .SH "SEE ALSO"
  181. .PP
  182. \fBmotd\fR(5),
  183. \fBpam.conf\fR(5),
  184. \fBpam.d\fR(5),
  185. \fBpam\fR(8)
  186. .SH "AUTHOR"
  187. .PP
  188. pam_motd was written by Ben Collins <bcollins@debian\&.org>\&.
  189. .PP
  190. The
  191. \fBmotd_dir=\fR
  192. option was added by Allison Karlitskaya <allison\&.karlitskaya@redhat\&.com>\&.