| 1 |
.TH "user_contexts" "5" "28-Nov-2011" "Security Enhanced Linux" "SELinux configuration" |
| 2 |
.SH "NAME" |
| 3 |
user_contexts \- The SELinux user contexts configuration files |
| 4 |
. |
| 5 |
.SH "DESCRIPTION" |
| 6 |
These optional user context configuration files contain entries that allow SELinux-aware login applications such as |
| 7 |
.BR PAM (8) |
| 8 |
(running in their own process context), to determine the context that a users login session should run under. |
| 9 |
.sp |
| 10 |
SELinux-aware login applications generally use one or more of the following libselinux functions that read these files from the active policy path: |
| 11 |
.RS |
| 12 |
.BR get_default_context (3) |
| 13 |
.br |
| 14 |
.BR get_ordered_context_list (3) |
| 15 |
.br |
| 16 |
.BR get_ordered_context_list_with_level (3) |
| 17 |
.br |
| 18 |
.BR get_default_context_with_level (3) |
| 19 |
.br |
| 20 |
.BR get_default_context_with_role (3) |
| 21 |
.br |
| 22 |
.BR get_default_context_with_rolelevel (3) |
| 23 |
.br |
| 24 |
.BR query_user_context (3) |
| 25 |
.br |
| 26 |
.BR manual_user_enter_context (3) |
| 27 |
.RE |
| 28 |
.sp |
| 29 |
There can be one file for each SELinux user configured on the system. The file path is formed using the path returned by |
| 30 |
.BR \%selinux_user_contexts_path (3) |
| 31 |
for the active policy, with the SELinux user name appended, for example: |
| 32 |
.RS |
| 33 |
.I /etc/selinux/{SELINUXTYPE}/contexts/users/unconfined_u |
| 34 |
.br |
| 35 |
.I /etc/selinux/{SELINUXTYPE}/contexts/users/xguest_u |
| 36 |
.RE |
| 37 |
.sp |
| 38 |
Where \fI{SELINUXTYPE}\fR is the entry from the selinux configuration file \fIconfig\fR (see \fBselinux_config\fR(5)). |
| 39 |
.sp |
| 40 |
These files contain context information as described in the |
| 41 |
.B FILE FORMAT |
| 42 |
section. |
| 43 |
. |
| 44 |
.SH "FILE FORMAT" |
| 45 |
Each line in the user context configuration file consists of the following: |
| 46 |
.RS |
| 47 |
.I login_process user_login_process |
| 48 |
.RE |
| 49 |
.sp |
| 50 |
Where: |
| 51 |
.RS |
| 52 |
.I login_process |
| 53 |
.RS |
| 54 |
This consists of a \fIrole\fB:\fItype\fR[\fB:\fIrange\fR] entry that represents the login process context. |
| 55 |
.RE |
| 56 |
.I user_login_process |
| 57 |
.RS |
| 58 |
This consists of a \fIrole\fB:\fItype\fR[\fB:\fIrange\fR] entry that represents the user login process context. |
| 59 |
.RE |
| 60 |
.RE |
| 61 |
. |
| 62 |
.SH "EXAMPLE" |
| 63 |
# Example for xguest_u at /etc/selinux/targeted/contexts/users/xguest_u |
| 64 |
.br |
| 65 |
system_r:crond_t:s0 xguest_r:xguest_t:s0 |
| 66 |
.br |
| 67 |
system_r:initrc_t:s0 xguest_r:xguest_t:s0 |
| 68 |
.br |
| 69 |
system_r:local_login_t:s0 xguest_r:xguest_t:s0 |
| 70 |
.br |
| 71 |
system_r:remote_login_t:s0 xguest_r:xguest_t:s0 |
| 72 |
.br |
| 73 |
system_r:sshd_t:s0 xguest_r:xguest_t:s0 |
| 74 |
.br |
| 75 |
system_r:xdm_t:s0 xguest_r:xguest_t:s0 |
| 76 |
.br |
| 77 |
xguest_r:xguest_t:s0 xguest_r:xguest_t:s0 |
| 78 |
. |
| 79 |
.SH "SEE ALSO" |
| 80 |
.ad l |
| 81 |
.nh |
| 82 |
.BR selinux "(8), " selinux_user_contexts_path "(3), " PAM "(8), " get_ordered_context_list "(3), " get_ordered_context_list_with_level "(3), " get_default_context_with_level "(3), " get_default_context_with_role "(3), " get_default_context_with_rolelevel "(3), " query_user_context "(3), " manual_user_enter_context "(3), " selinux_config "(5) " |