pam_tty_audit.8 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. '\" t
  2. .\" Title: pam_tty_audit
  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_TTY_AUDIT" "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_tty_audit \- Enable or disable TTY auditing for specified users
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_tty_audit\&.so\fR\ 'u
  34. \fBpam_tty_audit\&.so\fR [disable=\fIpatterns\fR] [enable=\fIpatterns\fR]
  35. .SH "DESCRIPTION"
  36. .PP
  37. The pam_tty_audit PAM module is used to enable or disable TTY auditing\&. By default, the kernel does not audit input on any TTY\&.
  38. .SH "OPTIONS"
  39. .PP
  40. \fBdisable=\fR\fB\fIpatterns\fR\fR
  41. .RS 4
  42. For each user matching
  43. \fB\fIpatterns\fR\fR, disable TTY auditing\&. This overrides any previous
  44. \fBenable\fR
  45. option matching the same user name on the command line\&. See NOTES for further description of
  46. \fB\fIpatterns\fR\fR\&.
  47. .RE
  48. .PP
  49. \fBenable=\fR\fB\fIpatterns\fR\fR
  50. .RS 4
  51. For each user matching
  52. \fB\fIpatterns\fR\fR, enable TTY auditing\&. This overrides any previous
  53. \fBdisable\fR
  54. option matching the same user name on the command line\&. See NOTES for further description of
  55. \fB\fIpatterns\fR\fR\&.
  56. .RE
  57. .PP
  58. \fBopen_only\fR
  59. .RS 4
  60. Set the TTY audit flag when opening the session, but do not restore it when closing the session\&. Using this option is necessary for some services that don\*(Aqt
  61. \fBfork()\fR
  62. to run the authenticated session, such as
  63. \fBsudo\fR\&.
  64. .RE
  65. .PP
  66. \fBlog_passwd\fR
  67. .RS 4
  68. Log keystrokes when ECHO mode is off but ICANON mode is active\&. This is the mode in which the tty is placed during password entry\&. By default, passwords are not logged\&. This option may not be available on older kernels (3\&.9?)\&.
  69. .RE
  70. .SH "MODULE TYPES PROVIDED"
  71. .PP
  72. Only the
  73. \fBsession\fR
  74. type is supported\&.
  75. .SH "RETURN VALUES"
  76. .PP
  77. PAM_SESSION_ERR
  78. .RS 4
  79. Error reading or modifying the TTY audit flag\&. See the system log for more details\&.
  80. .RE
  81. .PP
  82. PAM_SUCCESS
  83. .RS 4
  84. Success\&.
  85. .RE
  86. .SH "NOTES"
  87. .PP
  88. When TTY auditing is enabled, it is inherited by all processes started by that user\&. In particular, daemons restarted by a user will still have TTY auditing enabled, and audit TTY input even by other users unless auditing for these users is explicitly disabled\&. Therefore, it is recommended to use
  89. \fBdisable=*\fR
  90. as the first option for most daemons using PAM\&.
  91. .PP
  92. To view the data that was logged by the kernel to audit use the command
  93. \fBaureport \-\-tty\fR\&.
  94. .PP
  95. The
  96. \fB\fIpatterns\fR\fR
  97. are comma separated lists of glob patterns or ranges of uids\&. A range is specified as
  98. \fImin_uid\fR:\fImax_uid\fR
  99. where one of these values can be empty\&. If
  100. \fImin_uid\fR
  101. is empty only user with the uid
  102. \fImax_uid\fR
  103. will be matched\&. If
  104. \fImax_uid\fR
  105. is empty users with the uid greater than or equal to
  106. \fImin_uid\fR
  107. will be matched\&.
  108. .PP
  109. Please note that passwords in some circumstances may be logged by TTY auditing even if the
  110. \fBlog_passwd\fR
  111. is not used\&. For example, all input to an ssh session will be logged \- even if there is a password being typed into some software running at the remote host because only the local TTY state affects the local TTY auditing\&.
  112. .SH "EXAMPLES"
  113. .PP
  114. Audit all administrative actions\&.
  115. .sp
  116. .if n \{\
  117. .RS 4
  118. .\}
  119. .nf
  120. session required pam_tty_audit\&.so disable=* enable=root
  121. .fi
  122. .if n \{\
  123. .RE
  124. .\}
  125. .sp
  126. .SH "SEE ALSO"
  127. .PP
  128. \fBaureport\fR(8),
  129. \fBpam.conf\fR(5),
  130. \fBpam.d\fR(5),
  131. \fBpam\fR(8)
  132. .SH "AUTHOR"
  133. .PP
  134. pam_tty_audit was written by Miloslav Trmač <mitr@redhat\&.com>\&. The log_passwd option was added by Richard Guy Briggs <rgb@redhat\&.com>\&.