Default permissions for sg0 won't let me access it

Q I have a SCSI scanner, the node for which is /dev/sg0. I use KDE for my desktop and Sane and XSane to control the scanner. The problem is that the default permissions for sg0 do not permit me to access it. Whenever I click on the desktop icon for XSane, I get an error message that there is no device present. The device is owned by root and belongs to the group 'disks'. My user also belongs to that group. The default permissions are read+write for owner, but only read for group. Group requires read+write in order for XSane and Sane to see the scanner. So whenever I need to scan, I have to open a console window as root and run the chmod command to alter the permissions.

Unfortunately, the alteration only lasts for the session, and it reverts to the default on the next boot-up. This has only occurred since upgrading to SUSE 10 and never manifested itself on any of the earlier versions of SUSE I was advised to write a new udev rule. Based on the information revealed by udevinfo I have made several attempts at writing a rule to set the mode - but have not (yet) had any success.

A You are correct in thinking that udev is causing this, which is why it did not happen on earlier version of SUSE - they did not use udev. You already have a udev rule in place, in /etc/udev/rule.d/50-udev.rules.

KERNEL=="sg*", NAME="%k",
GROUP="disk", MODE="640"

All you need to get your scanner working is to change the MODE setting to 660, giving write permission to the disk group. However, changing this file is not recommended, because any subsequent update to udev will overwrite it and you'll be right back where you started. Instead, you should copy this line to /etc/udev/rule.d/10-udev.rules and modify it there. The lower-numbered file is processed first. To prevent its changes being overridden by a later rule, make the rule read:

KERNEL=="sg*", NAME="%k",
GROUP:="disk", MODE:="660"

The := assignations ensure that the settings will not be changed. Depending on how many people use your computer, and who you want to use the scanner, you may prefer to create a separate scanner group, either in Yast or with groupadd scanner and change the udev rule accordingly. Then you can add to that group only those users you want to be able to use the scanner.

Back to the list