Operating System - HP-UX
1833777 Members
2216 Online
110063 Solutions
New Discussion

Mount a cdrom without root permissions

 
SOLVED
Go to solution
Francisco J. Soler
Honored Contributor

Mount a cdrom without root permissions

Hello all, how can I mount the cdrom like a normal user? Without login with root permissions.

HP-UX 11.11

Thanks.
Frank.
Linux?. Yes, of course.
5 REPLIES 5
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: Mount a cdrom without root permissions

Hi Fransisco,

Install and configure sudo.

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.8p7/

Best regards,
Robert-Jan
Gopi Sekar
Honored Contributor

Re: Mount a cdrom without root permissions


two ways: either execute the mount command using sudo, this is known to work.

second change the ownership of the cdrom device, I am not sure whether mount command will like it
Never Never Never Giveup
Bill Hassell
Honored Contributor

Re: Mount a cdrom without root permissions

sudo is the only solution. The mount command doesn't care about permissions. It requires root privileges to modify the filesystem to include the CD (or any other mountable device). The mount command checks the user ID.


Bill Hassell, sysadmin
Rick Garland
Honored Contributor

Re: Mount a cdrom without root permissions

sudo is the tool to use.

http://www.courtsean.com
or
HP with the Internet Express for HPUX 11i v1 or 11i v2
http://software.hp.com and search for sudo
Francisco J. Soler
Honored Contributor

Re: Mount a cdrom without root permissions

Thanks all for yours suggestions.
sudo made the trick.

My solution was:
Install sudo (from depot file), edit the file /etc/sudoers and put this lines (ot6 is the hostname):

-- /etc/sudoers ---------
Host_Alias CDROM = ot6, localhost


ALL CDROM = NOPASSWD: /usr/sbin/mount /mnt/cdrom,\
/usr/sbin/umount /mnt/cdrom
--------- end sudoers file -----

in the /etc/fstab file the last line must be:

/dev/dsk/c0t0d0 /mnt/cdrom cdfs ro 0 0

Be sure the directory /mnt/cdrom exists.

Now to mount and umount a cd any user can do:

sudo mount /mnt/cdrom
sudo umount /mnt/cdrom

I have put a link in /usr/local/bin/mount and /usr/local/bin/umount pointing to /usr/sbin/mount and /usr/sbin/umount. Another way could be add /usr/sbin to the user's path


Frank.
Linux?. Yes, of course.