1 |
On 11/25/2011 08:32 PM, Stan Sander wrote: |
2 |
> One of the more important things that is currently broken on my system |
3 |
> when I switch on enforcing mode for SELinux is the su command. Mostly |
4 |
> likely I've overlooked something so am asking here first before filing a |
5 |
> bug on it. |
6 |
|
7 |
After doing some more searching, reading, and educating of myself I have |
8 |
been able to achieve the behavior I was wanting from the su command, |
9 |
namely change my regular Linux uid to 0 and be able to launch graphical |
10 |
programs if necessary when logged in to a desktop session. What I |
11 |
discovered leaves my SELinux user id set to the user I originally logged |
12 |
in as, which from a security and accountability standpoint is not a bad |
13 |
thing, but the role and type are updated so all the transitions needed |
14 |
for the policy to function as intended can occur. However, my Linux uid |
15 |
is 0 so things that need that work. Probably a simple concept for all |
16 |
you seasoned SELinux folk, but wanted to document it here for the |
17 |
benefit of others who may find this in the archives. |
18 |
|
19 |
My answer -- removing the calls to pam_selinux.so from the su file in |
20 |
pam.d and also removing the calls to pam_xauth.so from the su and |
21 |
newrole files. These (xauth) generated avc denials when they couldn't |
22 |
access root's home area at /root due to (I think) ubac constraints. |
23 |
The last step a very simple script I called sesu |
24 |
|
25 |
#!/bin/bash |
26 |
echo -n "X server: " |
27 |
xhost local:localhost |
28 |
echo -n "Enter root " |
29 |
su -c "echo -n \"Enter current user \" && newrole -r sysadm_r" |
30 |
|
31 |
If your PAM config doesn't allow the current user to su, then they get |
32 |
permission denied. |
33 |
If SELinux doesn't allow the current user to transition to a sysadm_r |
34 |
then you get a root shell, but with limited capability. |
35 |
|
36 |
|
37 |
-- |
38 |
Stan & HD Tashi Grad 10/08 Edgewood, NM SWR |
39 |
PR - Cindy and Jenny - Sammamish, WA NWR |
40 |
http://www.cci.org |