Solved

Permissions lost on reboot for reading CD-ROM drive

Posted on 2007-04-08
9
302 Views
Last Modified: 2013-12-16
I am running Suse 10.2 on a HP500 laptop.  Recently I modified the kernel to enable touchpad functionality.  Now the CD-ROM permissions (/dev/hdb) are set for "root" and "disk" but not for me or the group I belong to ("users").  I can restore the correct group or user permissions using chown or chgrp, but the changes are lost when I reboot and permission is denied again.

How can I set the permission to be permanent?  Or do I have to run a script each time I boot to do it for me?
0
Comment
Question by:Bloodrule
  • 5
  • 3
9 Comments
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
edit /etc/fstab and add the options there

/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0

the options can include the "users" option as well
0
 

Author Comment

by:Bloodrule
Comment Utility
I entered this line to /etc/fstab:

/dev/cdrom   /mnt/cdrom   udf,iso9660   noauto,owner,users,kudzu   0 0

(my default group is "users")

After rebooting /dev/hdb is still inaccessible, showing its permissions as ownership belonging to "root" and group "disk"

Have I omitted something?
0
 
LVL 4

Expert Comment

by:infleadorix
Comment Utility
Observe the output of the following commands:

# ls -l /dev/cdrom

Assuming that /dev/cdrom is a symlink to /dev/hda, create the /etc/udev/rules.d/99-my.rules file with the the following line in it:

KERNEL="hda", OWNER="username", GROUP="groupname", NAME="%k"

Replace username and groupname above with whatever you desire. Then either reboot the system or run the following commands:

# pkill udevd
# udevstart
0
 

Author Comment

by:Bloodrule
Comment Utility
Thanks but still no luck.  I wasn't sure if your suggestion needed to include the " " around the entries or not so I tried both ways.  This is what resulted:

ls -l /dev/cdrom produced:

lrwxrwxrwx 1 root root 3 2007-04-12 07:09 /dev/cdrom->hdb

So I created a new file 99-my.rules in /etc/udev/ with only one line as follows:

KERNEL=hdb, OWNER=peter, GROUP=users, NAME=%k

After rebooting, ls -l /dev/hdb produces:

brw-r----- 1 root disk 3, 64 2007-04-12 07:09 /dev/hdb

And the CDROM is stil inaccessible if I am logged in as "peter" but is available if I am logged in as root.

Can you see if I have made a mistake?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 4

Expert Comment

by:infleadorix
Comment Utility
I'm not sure where the 99-my.rules file is supposed to be located in SUSE, but I know it should be in the same directory as the other *.rules file.

Use quotation marks as shown in my example.

I'm not sure what you meant exactly when you said the CD-ROM is inaccessible. Did you mean that you want to be able to mount the drive as regular users? If so, just edit your /etc/fstab file with the following mount options:

noauto,user,ro,exec
0
 

Author Comment

by:Bloodrule
Comment Utility
I found a number of .rules files in /etc/udev/rules.d/, though there was no file called 99-my.rules.  I assumed that was to be a new file that I was creating.

What I meant was that if I boot as an ordinary user, the CD-ROM device is visible but I get permission denied messages if I try to use it eg play an audio CD.  If I am logged in as root, it works normally.

I'll try again...and thanks!
0
 

Author Comment

by:Bloodrule
Comment Utility
Still no luck.  Despite making the edits you suggested and rebooting, /dev/hdb is still forbidden unless I am root so I cannot play an audio CD or read/write to/ from a data CD while logged in as an ordinary user.

Hope you have some further advice.
0
 
LVL 4

Accepted Solution

by:
infleadorix earned 500 total points
Comment Utility
In that case, you might need to resort to the post initialization script, /etc/rc.d/rc.local. I don't have any SUSE machine here, so I'm not sure if the command I'll tell you (based on Red Hat) will work. Enter the following command:

# which start_udev

If the script exists, add it to the end of the /etc/rc.d/rc.local file, as follows:

/sbin/start_udev
0
 

Author Comment

by:Bloodrule
Comment Utility
Eventually I solved this as follows:

Yast/Security & Users/User Management/Users/Edit/Existing Local User/Details/Groups and checked the checbox against "Disks".  This gave the necessary permission after logging off and back on.

Thank you for your help.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now