LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Normal user being able to mount cdrom (https://www.linuxquestions.org/questions/slackware-14/normal-user-being-able-to-mount-cdrom-374364/)

dave`2005 10-18-2005 02:22 PM

Normal user being able to mount cdrom
 
Hi all,

sorry for this basic question but when i log in as my normal user i cant execute any of the commands i need, such as being able to mount the cdrom, iwconfig, installpkg and a few others.

Any help appreciated.

Jeebizz 10-18-2005 02:34 PM

Mounting a cdrom drive as a normal user is understandable, and the way to do it is to review your fstab, and under it look for the entry for your cdrom, and change the part that says "noauto,owner,ro" to "noauto,users,ro" , and that should enable you to mount your cdrom drive. As for the others, such as iwconfig, and installpkg, you do NOT want normal users to be able to do that, because that is a major risk, and you only want the adminstrator (you) to be able to install and remove things, and change system settings, not any other user, even though you are the only user on the machine, it is still good practice.

Hangdog42 10-18-2005 04:17 PM

You may want to investigate using sudo to grant normal users the ability to run specific commands that you specify with root privileges. I do that for a few things like iwconfig.

Woodsman 10-18-2005 04:43 PM

Here are my fstab entries. First CD drive is a writer, second is read-only.

/dev/sr0 /media/cdwriter iso9660 noauto,user,rw,unhide 0 0
/dev/hdd /media/cdrom iso9660 noauto,user,ro,unhide 0 0

I'm using the 2.4.28 kernel.

I also use GRUB and I added the hdc=ide-scsi switch to the boot options.

I use KDE as my GUI and I enable the KDE desktop device icons for the floppy and CD drives. There are two device icons for each device: mount and umount. But you always see only one icon or the other, depending upon the status of the device. When a CD or floppy is mounted a small green triangle appears in the device icon. These icons, along with my fstab, means I mount and umount my CDs, as well as eject, directly from the KDE desktop. All without hitches. Works well.

I hope this helps.

egag 10-18-2005 04:49 PM

you can also use autofs to auto-mount cd and floppy .
look here :

http://www.linuxquestions.org/questi...ghlight=autofs

a little down the thread is how it was explained to me.
and it works ok.

egag

jschiwal 10-21-2005 03:38 PM

If you decide to use sudo, you are supposed to use the root program "visudo" to edit the /etc/sudoers file. There are examples, in the comments of the file, on allowing users to execute certain commands. There is a commented example using the "shutdown" command. You might consider making the changes for members of the wheel group, and only allowing it to be done locally. These are covered in the examples. Also read through man sudo or info sudo. I'm not sure but sudo may be documented in the coreutils manual also.

One last thought. The /sbin directory may not be in the path of a normal user, so you may need to give the full pathname for some commands in the sudoers file. Or maybe in the /etc/profile script, you could conditionally add "/sbin" and "/usr/sbin" to the PATH variable only for wheel group members.

mylqname 10-21-2005 05:21 PM

An easy way to mount cdrom as user is to add the user to the cdrom group.

edit /etc/group
add your username to the cdrom entry
ex:
cdrom::19:myusername

Then you will always be able to mount and unmount cdroms with that user.

hth.


All times are GMT -5. The time now is 02:19 PM.