LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Busybox and user permissions: for example enable user to mount (https://www.linuxquestions.org/questions/linux-software-2/busybox-and-user-permissions-for-example-enable-user-to-mount-901387/)

numa 09-06-2011 04:31 AM

Busybox and user permissions: for example enable user to mount
 
Hi,

I hope that somebody can help me with the following question:

I have three users on my system which is based on Busybox:
* root
* admin
* myuser

I am trying to enable admin to do certain tasks which myuser should not be able to do, such as mounting a usb. To mount an usb a user should be able to run mdev and mount commands.

My question is how do I give permissions to admin but not to myuser? The restriction here is that I am using Busybox and I am limited to which packages I can add to the system.

Regards,

Emmanuel

Snark1994 09-06-2011 06:29 AM

There may be a way to do it with groups (ie. having a 'mount' group that the admin is part of, and the user isn't, and giving execute permission to group but not world for the 'mount' execution) but a far neater way would be to use the 'sudo' command. Do you have / can you install 'sudo' ?

numa 09-06-2011 09:27 AM

Hi Snark,

Thank you your advises.

The problem with the first solution is that mount is in fact a symbolic link to busybox and you can change the permission on a symbolic link.

The second solution sounds possible. I added the sudo package but I am having issue to make it work. I am trying to give permission to admin to mount and to use tcpdump but with no success for the moment. I will carry on trying ...

Thank you.

Emmanuel

Snark1994 09-06-2011 09:34 AM

You can put something in your sudoers along the lines of:

Code:

admin hostname=/sbin/mdev
admin hostname=/sbin/mount

...where hostname is your actual hostname :)

numa 09-06-2011 09:40 AM

Hi Snark,

Brilliant this is working now: tcpdump and mount.

Thank you for your help.

Emmanuel


All times are GMT -5. The time now is 11:53 PM.