LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   setting capabilities for a user (https://www.linuxquestions.org/questions/linux-security-4/setting-capabilities-for-a-user-302122/)

vmniza 03-15-2005 10:42 PM

setting capabilities for a user
 
I read somewhere that you can set capabilities for a user. For eg, if i set the capability CAP_SYS_MODULE for a user, will that user be able to load a kernel module. if so how can I set a capability for a user ?

Hangdog42 03-16-2005 05:54 PM

I'm going to guess that your thinking of sudo. Basically, sudo allows you to give users root privileges to run specific commands only. You do that by using the visudo command to edit the sudoers file. For example, if you wanted to give a user the ability to stop the computer, you would add the halt command to their entry in the sudoers file. Then they could use the command sudo halt to turn off the computer. However, that user wouldn't have root privileges to any command other than halt.

vmniza 03-17-2005 06:36 AM

Thanks!! It solved half my problem. But I don't think sudo gives capabilities to a user. There are functions like capset to set the capabilities. But I am not sure how it works. Do you have any idea ?

Hangdog42 03-17-2005 08:33 PM

Quote:

Originally posted by vmniza
Thanks!! It solved half my problem. But I don't think sudo gives capabilities to a user. There are functions like capset to set the capabilities. But I am not sure how it works. Do you have any idea ?
To be honest, I'm not entirely sure what you are aksing here. Sudo does give the user capabilites in that they can run commands that are normally not allowed. Could you be more specific about what you mean by capabilities, because your definintion seems to go beyond simply allowing new privileges with commands.

Capt_Caveman 03-17-2005 10:03 PM

Take a look at the Linux Kernel Capabilities FAQ. It's a little bit old, but to be honest I'm not sure how much has progressed since then with the recent migration to the SELinux DAC model. For manipulating Linux CAPS, take a look at lcap. From what I've seen, in the 2.6 kernels POSIX capabilities support is now integrated into the LSM architecture, though I'm not sure if that needs to be specifically enabled in the kernel.


All times are GMT -5. The time now is 11:23 AM.