LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to restrict RHEL5 to mount to /media directory (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-restrict-rhel5-to-mount-to-media-directory-731203/)

saagar 06-06-2009 11:59 PM

How to restrict RHEL5 to mount to /media directory
 
Friends,
When a normal user double click the CD drive icon, the CD file system gets mounted to /media/<name> directory. How do I restrict it. what is the configuration file which states "when a double click is made mount to /media/<name>?
thanks

okos 06-07-2009 12:09 AM

You need to set up a udev rule for the cdrom.

I had the same issue with a usb hdd with three partitions. At times when I would plug in the drive it would have different mount points and/or different device label.
So I wrote a rule for it and also added a fstab entry depicting who could mount the drives and a statc mount point.
That solved all my problems.


See the following tutorial on writing udev rules.
http://reactivated.net/writing_udev_rules.html

saagar 06-07-2009 08:09 AM

thanks a lot.
We can do this way too, is it not? make /media directory's permission 700.(in my case with /media as the only mount point)
again, Could you let me know is there a configuration file which states "when a double click is made mount to /media/<name>"

Tinkster 06-07-2009 01:30 PM

I still don't get where you're heading with this; does it
bother you that people can mount stuff at all, or is it
the mount-point you're really worried about (which, quite
frankly, doesn't make all that much sense)?

What are you trying to achieve? And what's the rationale?



Cheers,
Tink

okos 06-10-2009 12:11 AM

Tink,
I think what he is getting at is that the mount point changes.
For example, it could be /media/disk, /media/cd etc ....
I know that happened to me when I had my ipod mounted before my usb hdd or visa versa.


All times are GMT -5. The time now is 07:14 AM.