- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Allowing ordinary users to mount a CD
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2007 10:45 PM
04-26-2007 10:45 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2007 10:57 PM
04-26-2007 10:57 PM
Re: Allowing ordinary users to mount a CD
Install and configure sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2007 11:26 PM
04-26-2007 11:26 PM
Re: Allowing ordinary users to mount a CD
Aside from 'sudo', there's 'automount' and a pair of mount/umount scripts that are suid root.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p12/
# man 1m automount
# man 1 chmod
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2007 11:35 PM
04-26-2007 11:35 PM
Re: Allowing ordinary users to mount a CD
Sudo (super user do), generally pronounced , is a program for Unix-like operating systems such as BSD, Mac OS X, and Linux that allows users to run programs with the security privileges of another user (normally the system's superuser) in a secure manner.
By default it is installed in /usr/bin.
Download it from :
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p12/
Hope this helps,
Rgds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 01:28 AM
04-27-2007 01:28 AM
Re: Allowing ordinary users to mount a CD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 01:30 AM
04-27-2007 01:30 AM
Re: Allowing ordinary users to mount a CD
Rgds,
Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 02:20 AM
04-27-2007 02:20 AM
Re: Allowing ordinary users to mount a CD
One other reasonable option would be to write a simple C (wrapper) program that has its setuid bit set and is owned by 'root'. The code does nothing more than issue a 'mount' request for a specific CD/DVD drive.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 08:36 AM
04-27-2007 08:36 AM
Re: Allowing ordinary users to mount a CD
SUDO is the best way. Anything else such as writing a shell wrapper and setting the SUID bit is so full of security problems that you might as well tell all the users the root password.
> Sudo seems to require a user to enter a password, and even then he is restricted to a limited time.
Not at all. The default settings in sudoers is not meant to be useful but just has some basic sections. The password request is *NOT* for the root password but for the user to repeat their login password. However, you can turn off that option in sudoers. You can also remove the nag message that says to be careful. You can explicitly define the mount command and the umount command along with the mount point (ie, mount /cdrom).
> What I want to do is set something up, as root, once only, to permit all subsequent users to read a CD.
SUDO will do all of this for you in a secure manner. The user will simply type:
sudo mount /cdrom
And that's it. Check the man pages for the sudoers file.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 09:20 AM
04-27-2007 09:20 AM
Re: Allowing ordinary users to mount a CD
Depending upon the release you are running, you may *not* even be able to execute a setuid *shell* script. This will be the case, by default, beginning with 11.23. Notice, however, that my suggestion was not for a setuid shell script but rather a small piece of C-code to which the setuid bit is applied. The code performs an 'execv' call of a string that specifies a CD/DVD mount.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 09:27 AM
04-27-2007 09:27 AM
Re: Allowing ordinary users to mount a CD
I should hasten to add to:
> Depending upon the release you are running, you may *not* even be able to execute a setuid *shell* script.
That this is the default setting and can be overridden by setting the kenerl parameter 'secure_sid_scripts=0'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 09:27 AM
04-27-2007 09:27 AM
Re: Allowing ordinary users to mount a CD
I should hasten to add to:
> Depending upon the release you are running, you may *not* even be able to execute a setuid *shell* script.
That this is the default setting and can be overridden by setting the kenerl parameter 'secure_sid_scripts=0'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 10:56 PM
04-27-2007 10:56 PM
Re: Allowing ordinary users to mount a CD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2007 07:02 PM
04-29-2007 07:02 PM
Re: Allowing ordinary users to mount a CD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2007 12:14 AM
04-30-2007 12:14 AM
Re: Allowing ordinary users to mount a CD
you can create an automount map, which deals with local devices, so no further superuser intervention is need for mounting.
The unmounting will be done by the automounter as well, when no access to the device is done after some period of time.
In /etc/auto_master:
/media -ro /etc/auto.local
cat /etc/auto.local
cdrom -fstype=cdfs,rr,ro :/dev/cdrom
dvd -fstype=cdfs,cdcase,ro :/dev/cdrom
where /dev/cdrom is a hard link I created to the default device in the HW-path /dev/dsk/c0t0d0...
Note that the colon ':' is the redirection to a local device.
Having a medium inserted, the automounter will mount it when accessing it, e.g. via
ls -l /media/cdrom
mfG Peter
PS: After the addition of the new map, you'll have to execute
automount -v
to activate it.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2007 09:44 PM
04-30-2007 09:44 PM
Re: Allowing ordinary users to mount a CD
ln /dev/dsk/c3t1d0 /dev/cdrom
to create a hardware link, and entered:
automount -v
to activate the new map.
However, ls -l /media/cdrom just hangs.
Also, and if I can get this to work, automount cannot be used by a non-root user. The application I am writing will require that a non-root user can power up the HP C8000, log in, and read a CD that has been previously recorded. How often will automount need to be entered?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 01:09 AM
05-01-2007 01:09 AM
Re: Allowing ordinary users to mount a CD
Also, it won't work until automountd has been run. However, as I need to allow non-root users to power-up the workstation, and log in and read previously recorded CDs, your idea isn't quite what I wanted, as automountd and automount need to be executed, by root, whenever the workstation is powered-up. Apart from using sudo, I'm sure there must be a solution out there!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 02:24 AM
05-01-2007 02:24 AM
Re: Allowing ordinary users to mount a CD
Is there a reason not to use sudo since it gives you all your requirements. Users can mount and unmount CDs at anytime. You can even create an alias called cdmount and cdunmount:
alias cdmount="sudo mount /cdrom"
alias cdunmount="sudo mount /cdrom"
Put all the mount options in /etc/fstab including noauto so the CD won't be mounted automatically at bootup:
/dev/dsk/c0t4d0 /cdrom cdfs ro,rr,noauto 0 0
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 02:39 AM
05-01-2007 02:39 AM
Re: Allowing ordinary users to mount a CD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 03:01 AM
05-01-2007 03:01 AM
Re: Allowing ordinary users to mount a CD
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111
Download it from software.hp.com and search for express. Or click the above link and it should be a pre-packaged version. (depot)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 05:10 AM
05-01-2007 05:10 AM
Solutiononce the maps for automount are configured, it will restart at every system boot, when activated in
/etc/rc.config.d/ndsconf
AUTOFS=1
(or something similar - no HP at hand here)
Then no interaction with the root account is needed to mount or umount a CD:
Everytime a 'normal' user executes
ls /media/cdrom
the CD/DVD in the drive will be mounted.
After the inactivity timeout the CD will be umounted by the automount daemon and can be ejected.
Thus root is only needed to do the initial setup - the normal handling can be done by every user without additional privilegs.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 01:26 PM
05-01-2007 01:26 PM
Re: Allowing ordinary users to mount a CD
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 07:45 PM
05-01-2007 07:45 PM
Re: Allowing ordinary users to mount a CD
AUTOFS is 1 in the nfsconf file already.
However, NFS_CLIENT and NFS_SERVER are both set to "0", so I guess the settings in nfsconf are being ignored at boot up, so automount and automountd are not being run automatically. I am running a C8000 as a stand alone workstation, so do I set these two options to "1"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 08:28 PM
05-01-2007 08:28 PM
Re: Allowing ordinary users to mount a CD
on my server there is a setting for this, because the automounter is used for real NFS purposes as well. Having a rp3440 at hand now, I see that in
/sbin/init.d/nfs.client
the processing of the automount entry is done only when having set
NFS_CLIENT=1
in /etc/rc.config.d/nfsconf
Though not required, when automouunt is used purely for handling local devices, you must activate the NFS client to get it started at boot time.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2007 12:21 AM
05-02-2007 12:21 AM
Re: Allowing ordinary users to mount a CD
While the use of sudo would also have been a neat solution, automount is already built in.
Thanks for all replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2007 12:25 AM
05-02-2007 12:25 AM