Operating System - HP-UX
1832973 Members
2535 Online
110048 Solutions
New Discussion

Can a user that is not root use the mount command?

 
Judy Traynor
Valued Contributor

Can a user that is not root use the mount command?

Is there a way for a user who is not root (ie. an operator) use the mount command. We want our operators to mount opticals.

leslie.d.haynes@lmco.com
Sail With the Wind
11 REPLIES 11
Victor BERRIDGE
Honored Contributor

Re: Can a user that is not root use the mount command?

Hi,
Yes, by giving the operator the rights in a restricted sam (sam -r...).
He then can use sam (with you you allow him ...)

All the best

Victor
Darrell Allen
Honored Contributor

Re: Can a user that is not root use the mount command?

Yes. You can use either a suid script or sudo.

When you search this site you'll find a number of threads related to this issue.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Thierry Poels_1
Honored Contributor

Re: Can a user that is not root use the mount command?

Hi,

normally a user has no privilege to mount filesystems, CD-roms, ...
There are workingarounds of course:
- restricted sam
- sudo
- executable program with "set-owner-ID-on-file-execution"
- third-party software

see http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0xb2cecf38d6bdd5118ff10090279cd0f9,00.html

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Craig Rants
Honored Contributor

Re: Can a user that is not root use the mount command?

The mount command can be used by a non root user. I have never tried mount anything other than root so I don't know what the results will be.

Have you thought of giving them sudo? That could a path look at.

Good Luck,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
A. Clay Stephenson
Acclaimed Contributor

Re: Can a user that is not root use the mount command?

Hi:

Because mount is such a dangerous command, I would be tempted to create a setuid C program that is fully interactive or at least a sudo'ed shell scripts with lots and lots of error checking.
If it ain't broke, I can fix that.
Thierry Poels_1
Honored Contributor

Re: Can a user that is not root use the mount command?

Craig,

from the man pages:
"The mount command mounts file systems. <> a superuser can mount file systems. Other users can use mount to list mounted file systems."

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Bill Hassell
Honored Contributor

Re: Can a user that is not root use the mount command?

Just a note about sudo--it doesn't come standard on HP-UX but you can download it from http://hpux.connect.org.uk/

The advantage with sudo is that it tracks every usage, and for each user, you can limit the command, the options and the device file and mount point names.


Bill Hassell, sysadmin
Deshpande Prashant
Honored Contributor

Re: Can a user that is not root use the mount command?

HI
Configure the restriced sam for user/operator to mount/umount opticals using scripts to be run as root user, or use the freeware SUDO.

Thanks.
Prashant.
Take it as it comes.
harry d brown jr
Honored Contributor

Re: Can a user that is not root use the mount command?

Write a menu in your favorite scripting language to do such, and then change the owner to root and set the permissions to 4555. I personally would not allow anyone other than root to access a unprotected command.


live free or die
harry
Live Free or Die
Craig Rants
Honored Contributor

Re: Can a user that is not root use the mount command?

Thierry,
It is all semantics. Potatoes, Potatoes.

C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Darrell Allen
Honored Contributor

Re: Can a user that is not root use the mount command?

One other note concerning suid scripts: unless you want everyone to have permissions to execute the script, be sure to remove permissions for other. Use either chmod o-rwx or chmod 4550 and set the group to the whatever it is for your operators.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)