1PAM_SELINUX(8)                 Linux-PAM Manual                 PAM_SELINUX(8)
2
3
4

NAME

6       pam_selinux - PAM module to set the default security context
7

SYNOPSIS

9       pam_selinux.so [close] [debug] [open] [nottys] [verbose]
10                      [select_context] [env_params] [use_current_range]
11

DESCRIPTION

13       In a nutshell, pam_selinux sets up the default security context for the
14       next execed shell.
15
16       When an application opens a session using pam_selinux, the shell that
17       gets executed will be run in the default security context, or if the
18       user chooses and the pam file allows the selected security context.
19       Also the controlling tty will have it´s security context modified to
20       match the users.
21
22       Adding pam_selinux into a pam file could cause other pam modules to
23       change their behavior if the exec another application. The close and
24       open option help mitigate this problem. close option will only cause
25       the close portion of the pam_selinux to execute, and open will only
26       cause the open portion to run. You can add pam_selinux to the config
27       file twice. Add the pam_selinux close as the executes the open pass
28       through the modules, pam_selinux open_session will happen last. When
29       PAM executes the close pass through the modules pam_selinux
30       close_session will happen first.
31

OPTIONS

33       close
34           Only execute the close_session portion of the module.
35
36       debug
37           Turns on debugging via syslog(3).
38
39       open
40           Only execute the open_session portion of the module.
41
42       nottys
43           Do not try to setup the ttys security context.
44
45       verbose
46           attempt to inform the user when security context is set.
47
48       select_context
49           Attempt to ask the user for a custom security context role. If MLS
50           is on ask also for sensitivity level.
51
52       env_params
53           Attempt to obtain a custom security context role from PAM
54           environment. If MLS is on obtain also sensitivity level. This
55           option and the select_context option are mutually exclusive. The
56           respective PAM environment variables are SELINUX_ROLE_REQUESTED,
57           SELINUX_LEVEL_REQUESTED, and SELINUX_USE_CURRENT_RANGE. The first
58           two variables are self describing and the last one if set to 1
59           makes the PAM module behave as if the use_current_range was
60           specified on the command line of the module.
61
62       use_current_range
63           Use the sensitivity level of the current process for the user
64           context instead of the default level. Also suppresses asking of the
65           sensitivity level from the user or obtaining it from PAM
66           environment.
67

MODULE TYPES PROVIDED

69       Only the session module type is provided.
70

RETURN VALUES

72       PAM_AUTH_ERR
73           Unable to get or set a valid context.
74
75       PAM_SUCCESS
76           The security context was set successfully.
77
78       PAM_USER_UNKNOWN
79           The user is not known to the system.
80

EXAMPLES

82           auth     required  pam_unix.so
83           session  required  pam_permit.so
84           session  optional  pam_selinux.so
85
86

SEE ALSO

88       pam.conf(5), pam.d(5), pam(8)
89

AUTHOR

91       pam_selinux was written by Dan Walsh <dwalsh@redhat.com>.
92
93
94
95Linux-PAM Manual                  06/16/2009                    PAM_SELINUX(8)
Impressum