[Solved] How do I make Device permissions permanent?

Archived topics about LMDE 1
Forum rules
drewb0y
Level 1
Level 1
Posts: 5
Joined: Tue Mar 01, 2011 10:19 am

[Solved] How do I make Device permissions permanent?

Postby drewb0y » 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.

User avatar
dawgdoc
Level 9
Level 9
Posts: 2720
Joined: Mon Oct 05, 2009 12:53 am
Location: Formerly of Kentucky, the land of Mint Juleps

Re: How do I make Device permissions permanent?

Postby dawgdoc » 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 -- Mint 17 Cinnamon
READING: Little Brother by Cory Doctorow

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 CiaW » 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

User avatar
dawgdoc
Level 9
Level 9
Posts: 2720
Joined: Mon Oct 05, 2009 12:53 am
Location: Formerly of Kentucky, the land of Mint Juleps

Re: How do I make Device permissions permanent?

Postby dawgdoc » 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 -- Mint 17 Cinnamon
READING: Little Brother by Cory Doctorow

drewb0y
Level 1
Level 1
Posts: 5
Joined: Tue Mar 01, 2011 10:19 am

[Solved] How do I make Device permissions permanent?

Postby drewb0y » 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.

User avatar
dawgdoc
Level 9
Level 9
Posts: 2720
Joined: Mon Oct 05, 2009 12:53 am
Location: Formerly of Kentucky, the land of Mint Juleps

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

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

Great job drewboy

You have the Google-Fuu
Image

SYSTEM: Compaq Presario CQ62 -- Mint 17 Cinnamon
READING: Little Brother by Cory Doctorow


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 2 guests