System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

giving permission to execute command

amipankaj
Frequent Advisor

giving permission to execute command

Hello Experts,

is this possible to give permission to some user to execute mount/umount certain file systems?

what i believ is ....we can give permission to execute mount/unmount command to some user...but can't strict it with certain file systems...after giving permission, he will be able to mount/unmount any file system.


please let me know your advice.

Thanks and regards,
Pankaj Roy
3 REPLIES
Autocross.US
Trusted Contributor

Re: giving permission to execute command

You can use sudo to give a user/group access to mount a specific filesystem.

an entry like this in the sudoers file would work:

username ALL = NOPASSWD: mount /filesystem
username ALL = NOPASSWD: umount /filesystem

More info on sudo:
http://www.courtesan.com/sudo/sudo.html



I drive way too fast to worry about calories.
Denver Osborn
Honored Contributor

Re: giving permission to execute command

I would look into using SuDo for this.

go to http://www.software.hp.com and search for SuDo

-denver
Laurent Menase
Honored Contributor

Re: giving permission to execute command

You can look at RBAC,

or make a small program with the setuid bit root. chmod 4555

If that program begin with getuid() to check the user who call it.
then call
main()
{
int i;
i=getuid();
if (!checkidallowed(i))
{
printf("user not allowed");
}
setuid(0);
system("/sbin/mount ......");
}

Where checkidallowed is a function which test if that user as the right to do it.