[Solved] How do I make Device permissions permanent?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

[Solved] How do I make Device permissions permanent?

Postby drewb0y on Mon Mar 07, 2011 4:37 pm

I have been using Nero Linux as burning program for a while and just got it set up in my LMDE. It will not detect the DVDRW until I manually change the device to rw using the following

Code: Select all
chmod o+r+w /dev/sg*


which changes it to
Code: Select all
crw----rw- 1 root root  21, 0 Mar  7 09:15 /dev/sg0
crw-rw-rw- 1 root cdrom 21, 1 Mar  7 09:15 /dev/sg1
crw----rw- 1 root root  21, 2 Mar  7 09:15 /dev/sg2
crw----rw- 1 root root  21, 3 Mar  7 09:15 /dev/sg3


However, every time i reboot it goes back to

Code: Select all
crw-------  1 root root   21,   0 Mar  7 09:15 sg0
crw-rw----  1 root cdrom  21,   1 Mar  7 09:15 sg1
crw-------  1 root root   21,   2 Mar  7 09:15 sg2
crw-------  1 root root   21,   3 Mar  7 09:15 sg3


How do I make this permanent? Is it in fstab somewhere?

Solution here
Last edited by drewb0y on Tue Mar 08, 2011 12:56 pm, edited 1 time in total.
drewb0y
Level 1
Level 1
 
Posts: 5
Joined: Tue Mar 01, 2011 10:19 am

Linux Mint is funded by ads and donations.
 

Re: How do I make Device permissions permanent?

Postby dawgdoc on Mon Mar 07, 2011 5:11 pm

You might try adding yourself to the cdrom group.
> Menu > Administration > Users and Groups, then select the <Manage Groups> button at the bottom. After giving your password and highlighting the cdrom group in the Group Settings popup, select Properties and then tick your username.

You can check the user group file with
Code: Select all
cat /etc/group | grep cdrom
The man page will explain the output if needed.
Image

SYSTEM: Compaq Presario CQ62 Dual-Boot: Mint 13 Gnome x32 PAE, LMDE
READING: The Autobiography of Benvenuto Cellini
User avatar
dawgdoc
Level 9
Level 9
 
Posts: 2690
Joined: Mon Oct 05, 2009 12:53 am
Location: Kentucky, USA the land of Mint Juleps

Re: How do I make Device permissions permanent?

Postby CiaW on Mon Mar 07, 2011 6:32 pm

I know there's also a way to do it using something called 'sticky bits'. (i.e. use the directory sticky bit). I haven't done much with it because I never feel like searching out details when I want to use it. :?

Here's a couple links that look like they'd be helpful:
http://www.techcuriosity.com/resources/ ... _linux.php

http://www.codecoffee.com/tipsforlinux/ ... s/028.html
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: How do I make Device permissions permanent?

Postby dawgdoc on Mon Mar 07, 2011 11:09 pm

CiaW,

Thank you for posting those. I have never used any of them that I recall; Sticky Bit, SGID, and SUID. I read both links and the man pages for chmod and chown. All of this prompts learning and better understanding on my part. I am still a little unclear on Sticky Bit because of this in the second link
Setting the sticky bit tells Unix that once the concerned application is executed, it should remain in memory. Remember that Unix is a multi-user OS and was mainly designed so that multiple users can work simultaneously. Thus the logic used is that a program that exists in memory requires lesser time to start when a new user requests for the same program. Thus when one user has just used a program and then a new user wants to use the same program, the second user doesn't have to face a time delay for the program to initialize itself. It would be readily available to him.

So I understand Sticky Bit preventing any but the file owner from deleting the file and it improving performance if multiple users are logged in with it keeping the file in memory. Also that SGID and SUID would allow others access to the files depending on the chmod permission options he set.

Since Drew did not mention problems relating to a Multi-User environment but having to reset permissions after each reboot, as long as he prefaced the chmod command with sudo and added 777 (rwx for user, group, and others) in the command, would it have accomplished all he needed?
Image

SYSTEM: Compaq Presario CQ62 Dual-Boot: Mint 13 Gnome x32 PAE, LMDE
READING: The Autobiography of Benvenuto Cellini
User avatar
dawgdoc
Level 9
Level 9
 
Posts: 2690
Joined: Mon Oct 05, 2009 12:53 am
Location: Kentucky, USA the land of Mint Juleps

[Solved] How do I make Device permissions permanent?

Postby drewb0y on Tue Mar 08, 2011 12:54 pm

OK, I managed to find a good solution for this. (Many thanks to Google!)

Short Tip: A simple udev rule for burn rights on /dev/sg*

In my case, I had already added my user to the cdrom group so the code I put in for /etc/udev/rules.d/55-disk-burning.rules is as follows

Code: Select all
BUS=="scsi", KERNEL=="sg[0-9]*", GROUP="cdrom", MODE="0666"


So after a reboot, instead of
Code: Select all
crw-------  1 root root   21,   0 Mar  7 09:15 sg0
crw-rw----  1 root cdrom  21,   1 Mar  7 09:15 sg1
crw-------  1 root root   21,   2 Mar  7 09:15 sg2
crw-------  1 root root   21,   3 Mar  7 09:15 sg3

I now have
Code: Select all
/dev $ ls -al sg*
crw-rw-rw- 1 root cdrom 21, 0 Mar  8 09:45 sg0
crw-rw-rw- 1 root cdrom 21, 1 Mar  8 09:45 sg1
crw-rw-rw- 1 root cdrom 21, 2 Mar  8 09:45 sg2
crw-rw-rw- 1 root cdrom 21, 3 Mar  8 09:45 sg3
crw-rw-rw- 1 root cdrom 21, 4 Mar  8 09:45 sg4


And Nero works properly without having to be messed with at all.
drewb0y
Level 1
Level 1
 
Posts: 5
Joined: Tue Mar 01, 2011 10:19 am

Re: [Solved] How do I make Device permissions permanent?

Postby dawgdoc on Tue Mar 08, 2011 10:36 pm

Great job drewboy

You have the Google-Fuu
Image

SYSTEM: Compaq Presario CQ62 Dual-Boot: Mint 13 Gnome x32 PAE, LMDE
READING: The Autobiography of Benvenuto Cellini
User avatar
dawgdoc
Level 9
Level 9
 
Posts: 2690
Joined: Mon Oct 05, 2009 12:53 am
Location: Kentucky, USA the land of Mint Juleps


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 4 guests