[Solved] How do I make Device permissions permanent?

Archived topics about LMDE 1 and LMDE 2
Locked
drewb0y

[Solved] How do I make Device permissions permanent?

Post by drewb0y »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
dawgdoc

Re: How do I make Device permissions permanent?

Post by dawgdoc »

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

Re: How do I make Device permissions permanent?

Post by CiaW »

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
dawgdoc

Re: How do I make Device permissions permanent?

Post by dawgdoc »

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?
drewb0y

[Solved] How do I make Device permissions permanent?

Post by drewb0y »

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.
dawgdoc

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

Post by dawgdoc »

Great job drewboy

You have the Google-Fuu
Locked

Return to “LMDE Archive”