user_selinux(8) - Linux man page
Name
user_u - Generic unprivileged user - Security Enhanced Linux Policy
Description
user_u is an SELinux User defined in the SELinux policy. SELinux users have default roles, user_r. The default role has a default type, user_t, associated with it.
The SELinux user will usually login to a system with a context that looks like:
user_u:user_r:user_t:s0-s0:c0.c1023
Linux users are automatically assigned an SELinux users at login. Login programs use the SELinux User to assign initial context to the user's shell.
SELinux policy uses the context to control the user's access.
By default all users are assigned to the SELinux user via the __default__ flag
On Targeted policy systems the __default__ user is assigned to the unconfined_u SELinux user.
You can list all Linux User to SELinux user mapping using:
semanage login -l
If you wanted to change the default user mapping to use the user_u user, you would execute:
semanage login -m -s user_u __default__
User Description
The SELinux user user_u is defined in policy as a unprivileged user. SELinux prevents unprivileged users from doing administration tasks without transitioning to a different role.
Sudo
X Windows Login
The SELinux user user_u is able to X Windows login.
Network
The SELinux user user_u is able to listen on the following tcp ports.
- xserver_port_t: 6000-6150
- The SELinux user user_u is able to connect to the following tcp ports.
- all ports
- The SELinux user user_u is able to listen on the following udp ports.
- all ports with out defined types
- The SELinux user user_u is able to connect to the following tcp ports.
- all ports
Booleans
SELinux policy is customizable based on least access required. user policy is extremely flexible and has several booleans that allow you to manipulate the policy and run user with the tightest access possible.
If you want to allow unprivileged users to execute DDL statement, you must turn on the sepgsql_enable_users_ddl boolean.
setsebool -P sepgsql_enable_users_ddl 1
If you want to allow user processes to change their priority, you must turn on the user_setrlimit boolean.
setsebool -P user_setrlimit 1
If you want to allow regular users direct mouse access, you must turn on the user_direct_mouse boolean.
setsebool -P user_direct_mouse 1
If you want to control users use of ping and traceroute, you must turn on the user_ping boolean.
setsebool -P user_ping 1
If you want to allow users to run TCP servers (bind to ports and accept connection from the same domain and outside users) disabling this forces FTP passive mode and may change other protocols, you must turn on the user_tcp_server boolean.
setsebool -P user_tcp_server 1
If you want to allow w to display everyone, you must turn on the user_ttyfile_stat boolean.
setsebool -P user_ttyfile_stat 1
If you want to allow users to connect to PostgreSQL, you must turn on the allow_user_postgresql_connect boolean.
setsebool -P allow_user_postgresql_connect 1
If you want to allow httpd to read user content, you must turn on the httpd_read_user_content boolean.
setsebool -P httpd_read_user_content 1
If you want to allow regular users direct dri device access, you must turn on the user_direct_dri boolean.
setsebool -P user_direct_dri 1
If you want to allow webadm to manage files in users home directories, you must turn on the webadm_manage_user_files boolean.
setsebool -P webadm_manage_user_files 1
If you want to allow pppd to be run for a regular user, you must turn on the pppd_for_user boolean.
setsebool -P pppd_for_user 1
If you want to allow user to r/w files on filesystems that do not have extended attributes (FAT, CDROM, FLOPPY), you must turn on the user_rw_noexattrfile boolean.
setsebool -P user_rw_noexattrfile 1
If you want to allow exim to create, read, write, and delete unprivileged user files, you must turn on the exim_manage_user_files boolean.
setsebool -P exim_manage_user_files 1
If you want to allow users to connect to mysql, you must turn on the allow_user_mysql_connect boolean.
setsebool -P allow_user_mysql_connect 1
If you want to allow exim to read unprivileged user files, you must turn on the exim_read_user_files boolean.
setsebool -P exim_read_user_files 1
If you want to allow webadm to read files in users home directories, you must turn on the webadm_read_user_files boolean.
setsebool -P webadm_read_user_files 1
If you want to allow ncftool to read user content, you must turn on the ncftool_read_user_content boolean.
setsebool -P ncftool_read_user_content 1
If you want to allow unprivileged users to execute DDL statement, you must turn on the sepgsql_enable_users_ddl boolean.
setsebool -P sepgsql_enable_users_ddl 1
If you want to allow user processes to change their priority, you must turn on the user_setrlimit boolean.
setsebool -P user_setrlimit 1
If you want to allow regular users direct mouse access, you must turn on the user_direct_mouse boolean.
setsebool -P user_direct_mouse 1
If you want to control users use of ping and traceroute, you must turn on the user_ping boolean.
setsebool -P user_ping 1
If you want to allow users to run TCP servers (bind to ports and accept connection from the same domain and outside users) disabling this forces FTP passive mode and may change other protocols, you must turn on the user_tcp_server boolean.
setsebool -P user_tcp_server 1
If you want to allow w to display everyone, you must turn on the user_ttyfile_stat boolean.
setsebool -P user_ttyfile_stat 1
If you want to allow users to connect to PostgreSQL, you must turn on the allow_user_postgresql_connect boolean.
setsebool -P allow_user_postgresql_connect 1
If you want to allow httpd to read user content, you must turn on the httpd_read_user_content boolean.
setsebool -P httpd_read_user_content 1
If you want to allow regular users direct dri device access, you must turn on the user_direct_dri boolean.
setsebool -P user_direct_dri 1
If you want to allow webadm to manage files in users home directories, you must turn on the webadm_manage_user_files boolean.
setsebool -P webadm_manage_user_files 1
If you want to allow pppd to be run for a regular user, you must turn on the pppd_for_user boolean.
setsebool -P pppd_for_user 1
If you want to allow user to r/w files on filesystems that do not have extended attributes (FAT, CDROM, FLOPPY), you must turn on the user_rw_noexattrfile boolean.
setsebool -P user_rw_noexattrfile 1
If you want to allow exim to create, read, write, and delete unprivileged user files, you must turn on the exim_manage_user_files boolean.
setsebool -P exim_manage_user_files 1
If you want to allow users to connect to mysql, you must turn on the allow_user_mysql_connect boolean.
setsebool -P allow_user_mysql_connect 1
If you want to allow exim to read unprivileged user files, you must turn on the exim_read_user_files boolean.
setsebool -P exim_read_user_files 1
If you want to allow webadm to read files in users home directories, you must turn on the webadm_read_user_files boolean.
setsebool -P webadm_read_user_files 1
If you want to allow ncftool to read user content, you must turn on the ncftool_read_user_content boolean.
setsebool -P ncftool_read_user_content 1
HOME_EXEC
The SELinux user user_u is able execute home content files.
Transitions
Three things can happen when user_t attempts to execute a program.
1. SELinux Policy can deny user_t from executing the program.
- 2. SELinux Policy can allow user_t to execute the program in the current user type.
- Execute the following to see the types that the SELinux user user_t can execute without transitioning:
search -A -s user_t -c file -p execute_no_trans
- 3. SELinux can allow user_t to execute the program and transition to a new type.
- Execute the following to see the types that the SELinux user user_t can execute and transition:
$ search -A -s user_t -c process -p transition
Managed Files
The SELinux process type user_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions.
anon_inodefs_t
auth_cache_t
/var/cache/coolkey(/.*)?
- cgroup_t
/cgroup(/.*)?
- chrome_sandbox_tmpfs_t
games_data_t
/var/games(/.*)?
/var/lib/games(/.*)?
- gpg_agent_tmp_t
httpd_user_content_t
/home/[^/]*/((www)|(web)|(public_html))(/.+)?
- httpd_user_htaccess_t
httpd_user_ra_content_t
httpd_user_rw_content_t
httpd_user_script_exec_t
iceauth_home_t
/home/[^/]*/.DCOP.*
/home/[^/]*/.ICEauthority.*
/home/[^/]*/.ICEauthority.*
- initrc_tmp_t
mail_spool_t
/var/mail(/.*)?
/var/spool/imap(/.*)?
/var/spool/mail(/.*)?
- mnt_t
/mnt(/[^/]*)
/mnt(/[^/]*)?
/rhev(/[^/]*)?
/media(/[^/]*)
/media(/[^/]*)?
/etc/rhgb(/.*)?
/media/.hal-.*
/net
/afs
/misc
/rhev
- mqueue_spool_t
/var/spool/(client)?mqueue(/.*)?
- nfsd_rw_t
noxattrfs
all files on file systems which do not support extended attributes
- sandbox_file_t
sandbox_tmpfs_type
all sandbox content in tmpfs file systems
- screen_home_t
/root/.screen(/.*)?
/home/[^/]*/.screen(/.*)?
/home/[^/]*/.screenrc
- screen_var_run_t
/var/run/screen(/.*)?
- security_t
tmp_t
/tmp
/usr/tmp
/var/tmp
/var/tmp/vi.recover
- usbfs_t
user_fonts_cache_t
/home/[^/]*/.fonts/auto(/.*)?
/home/[^/]*/.fontconfig(/.*)?
/home/[^/]*/.fonts.cache-.*
- user_fonts_t
/home/[^/]*/.fonts(/.*)?
- user_home_type
all user home files
- user_tmp_t
/tmp/gconfd-.*
- user_tmpfs_t
/dev/shm/mono.*
/dev/shm/pulse-shm.*
- xauth_home_t
/root/.Xauth.*
/root/.xauth.*
/root/.serverauth.*
/var/lib/pqsql/.xauth.*
/var/lib/pqsql/.Xauthority.*
/var/lib/nxserver/home/.xauth.*
/var/lib/nxserver/home/.Xauthority.*
/home/[^/]*/.xauth.*
/home/[^/]*/.Xauthority.*
/home/[^/]*/.serverauth.*
- xdm_tmp_t
/tmp/.X11-unix(/.*)?
/tmp/.ICE-unix(/.*)?
/tmp/.X0-lock
- xserver_tmpfs_t
Commands
semanage fcontext can also be used to manipulate default file context mappings.
semanage permissive can also be used to manipulate whether or not a process type is permissive.
semanage module can also be used to enable/disable/install/remove policy modules.
semanage boolean can also be used to manipulate the booleans
system-config-selinux is a GUI tool available to customize SELinux policy settings.
Author
This manual page was auto-generated using sepolicy manpage by mgrepl.
See Also
selinux(8), user(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8), useradd_selinux(8), usernetctl_selinux(8)