Guide to replace root as sysadm for machine
I am stumbling my way through using a non-root user as the sysadm for the computer. Is there any advice on this?
My goal is to have a non-root user able to do the following on my Gentoo box:
< User: storri - in sysadm_r (or whatever is appropriate) >
- emerge rsync
- emerge -av --deep world (or any package)
< User: storri - in user_r >
- compile source code in home directory.
I figured I would start small. So far I am a bit stuck on getting the user sorted out. I figure that have a goal, two non-root users able to do normally 'root' actions I would be on my way to learning how to configure selinux.
So far I have added storri to the /etc/security/selinux/src/policy/user with the following:
user storri roles { user_r sysadm_r };
Beyond this would I need to change the normal 'user' and 'group' ownership for those directories touched by the emerge application?
Stephen
Signature · 7 lines
Email: [email protected] -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
dear stephen,
remember that the normal unix permissions are applied FIRST and then the selinux ones second.
therefore you will first need to think of a way to achieve what you want to do - on a non-selinux-enabled system.
one possible way which more experienced gentoo users will likely tell you "noooooo don't do that!" would be to make emerge setuid to root.
... maybe a better way would be to write a small program that su's to root, asks for the root password (or _a_ password at least), and then exec's emerge.
at least that way once you have it working you can write an selinux policy to cover the use of that program.
l.
Quoted 36 lines · Stephen torri
I am stumbling my way through using a non-root user as the sysadm for the computer. Is there any advice on this?
My goal is to have a non-root user able to do the following on my Gentoo box:
< User: storri - in
sysadm_r(or whatever is appropriate) >
- emerge rsync
- emerge -av --deep world (or any package)< User: storri - in
user_r>
- compile source code in home directory.I figured I would start small. So far I am a bit stuck on getting the user sorted out. I figure that have a goal, two non-root users able to do normally 'root' actions I would be on my way to learning how to configure selinux.
So far I have added storri to the
/etc/security/selinux/src/policy/userwith the following:user storri roles {
user_rsysadm_r};Beyond this would I need to change the normal 'user' and 'group' ownership for those directories touched by the emerge application?
Stephen
Signature · 7 lines
Email: [email protected] -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 13 lines
-- Truth, honesty and respect are rare commodities that all spring from the same well: Love. If you love yourself and everyone and everything around you, funnily and coincidentally enough, life gets a lot better. -- <a href="http://lkcl.net"> lkcl.net </a> <br /> <a href="mailto:[email protected]"> [email protected] </a> <br /> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Hi,
try using things like fakeroot. Just like Debian does for building
packages: you build the package as user but using fakeroot (so the software thinks it is root, and chmod calls are logged. and since the package is being tarred while still in the fakeroot env the permissions are stored as set in the fakeroot)
Then you obtain real "root" access to install it in on you system. Avoids lots of trouble this approach.
Greetings,
Erich Schubert
Signature · 9 lines
erich@(vitavonni.de|debian.org) -- GPG Key ID: 4B3A135C (o_
There was never a good war or a bad peace. - Benjamin Franklin //\
Der Anfang aller Erkenntnis ist das Staunen. --- Aristoteles V_/_
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.