pam_umask.8 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. '\" t
  2. .\" Title: pam_umask
  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_UMASK" "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_umask \- PAM module to set the file mode creation mask
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_umask\&.so\fR\ 'u
  34. \fBpam_umask\&.so\fR [debug] [silent] [usergroups] [nousergroups] [umask=\fImask\fR]
  35. .SH "DESCRIPTION"
  36. .PP
  37. pam_umask is a PAM module to set the file mode creation mask of the current environment\&. The umask affects the default permissions assigned to newly created files\&.
  38. .PP
  39. The PAM module tries to get the umask value from the following places in the following order:
  40. .sp
  41. .RS 4
  42. .ie n \{\
  43. \h'-04'\(bu\h'+03'\c
  44. .\}
  45. .el \{\
  46. .sp -1
  47. .IP \(bu 2.3
  48. .\}
  49. umask= entry in the user\*(Aqs GECOS field
  50. .RE
  51. .sp
  52. .RS 4
  53. .ie n \{\
  54. \h'-04'\(bu\h'+03'\c
  55. .\}
  56. .el \{\
  57. .sp -1
  58. .IP \(bu 2.3
  59. .\}
  60. umask= argument
  61. .RE
  62. .sp
  63. .RS 4
  64. .ie n \{\
  65. \h'-04'\(bu\h'+03'\c
  66. .\}
  67. .el \{\
  68. .sp -1
  69. .IP \(bu 2.3
  70. .\}
  71. UMASK entry from /etc/login\&.defs
  72. .RE
  73. .sp
  74. .RS 4
  75. .ie n \{\
  76. \h'-04'\(bu\h'+03'\c
  77. .\}
  78. .el \{\
  79. .sp -1
  80. .IP \(bu 2.3
  81. .\}
  82. UMASK= entry from /etc/default/login
  83. .RE
  84. .PP
  85. The GECOS field is split on comma \*(Aq,\*(Aq characters\&. The module also in addition to the umask= entry recognizes pri= entry, which sets the nice priority value for the session, and ulimit= entry, which sets the maximum size of files the processes in the session can create\&.
  86. .SH "OPTIONS"
  87. .PP
  88. .PP
  89. \fBdebug\fR
  90. .RS 4
  91. Print debug information\&.
  92. .RE
  93. .PP
  94. \fBsilent\fR
  95. .RS 4
  96. Don\*(Aqt print informative messages\&.
  97. .RE
  98. .PP
  99. \fBusergroups\fR
  100. .RS 4
  101. If the user is not root and the username is the same as primary group name, the umask group bits are set to be the same as owner bits (examples: 022 \-> 002, 077 \-> 007)\&.
  102. .RE
  103. .PP
  104. \fBnousergroups\fR
  105. .RS 4
  106. This is the direct opposite of the usergroups option described above, which can be useful in case pam_umask has been compiled with usergroups enabled by default and you want to disable it at runtime\&.
  107. .RE
  108. .PP
  109. \fBumask=\fR\fB\fImask\fR\fR
  110. .RS 4
  111. Sets the calling process\*(Aqs file mode creation mask (umask) to
  112. \fBmask\fR
  113. & 0777\&. The value is interpreted as Octal\&.
  114. .RE
  115. .SH "MODULE TYPES PROVIDED"
  116. .PP
  117. Only the
  118. \fBsession\fR
  119. type is provided\&.
  120. .SH "RETURN VALUES"
  121. .PP
  122. .PP
  123. PAM_SUCCESS
  124. .RS 4
  125. The new umask was set successfully\&.
  126. .RE
  127. .PP
  128. PAM_BUF_ERR
  129. .RS 4
  130. Memory buffer error\&.
  131. .RE
  132. .PP
  133. PAM_CONV_ERR
  134. .RS 4
  135. The conversation method supplied by the application failed to obtain the username\&.
  136. .RE
  137. .PP
  138. PAM_INCOMPLETE
  139. .RS 4
  140. The conversation method supplied by the application returned PAM_CONV_AGAIN\&.
  141. .RE
  142. .PP
  143. PAM_SERVICE_ERR
  144. .RS 4
  145. No username was given\&.
  146. .RE
  147. .PP
  148. PAM_USER_UNKNOWN
  149. .RS 4
  150. User not known\&.
  151. .RE
  152. .SH "EXAMPLES"
  153. .PP
  154. Add the following line to
  155. /etc/pam\&.d/login
  156. to set the user specific umask at login:
  157. .sp
  158. .if n \{\
  159. .RS 4
  160. .\}
  161. .nf
  162. session optional pam_umask\&.so umask=0022
  163. .fi
  164. .if n \{\
  165. .RE
  166. .\}
  167. .sp
  168. .SH "SEE ALSO"
  169. .PP
  170. \fBpam.conf\fR(5),
  171. \fBpam.d\fR(5),
  172. \fBpam\fR(8)
  173. .SH "AUTHOR"
  174. .PP
  175. pam_umask was written by Thorsten Kukuk <kukuk@thkukuk\&.de>\&.