Difference between revisions of "Scanner Server"
Line 1: | Line 1: | ||
== Preventing permissions issues == | == Preventing permissions issues == | ||
+ | We want to make the scanner RW for a scanner group, that Apache is a member of and has access to. To do this, start by making a new group:<BR> | ||
+ | su - | ||
+ | groupadd -r scanner<BR><BR> | ||
+ | Add apache and root to the new group:<br> | ||
+ | usermod -G scanner apache<br> | ||
+ | usermod -G scanner root<br><br> | ||
− | + | Next, we need to tell the system to set the scanner permissions so it uses the new group. <br><br> | |
+ | To do that, we need to know how to identify the scanner. I'm assuming you have a USB scanner; if not, the process is similar, but I'm not sure how to identify the scanner correctly. <p> | ||
− | + | With the scanner plugged in, run the lsusb command. You'll get several lines like this:<br> | |
+ | Bus 001 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse<br> | ||
+ | <br> | ||
+ | Look for the one that looks like it's for your scanner, and write down the two numbers next to ID (in this case, if the mouse was actually a scanner, 046d and c00e). The left number is the vendor ID, and the right is the product ID.<br><br> | ||
− | + | Go to /lib/udev.<br> | |
+ | Edit the 50_udev_default.rules file. You're looking for a line like this: | ||
+ | <br><br> | ||
+ | SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" (might be mode 0664 instead) | ||
+ | <br> | ||
+ | This says "when a device is plugged into the USB bus, add a device under /dev/bus/usb/<BUS NUMBER> called <DEVICE NUMBER>, with permissions owner (root) RW, and everyone else read only".<br><br> | ||
− | + | Add a line above that one that says:<br> | |
− | + | BUS="usb", ATTRS{idVendor}=="<left number from lsusb>", ATTRS{idProduct}=="<right number from lsusb>", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0664", GROUP="scanner"<br><br> | |
− | <br> | + | This tells the system "If this SPECIFIC USB device is plugged in, make it mode 664 instead of 644, and make it part of the scanner group. |
− |
Revision as of 04:07, 31 August 2009
Preventing permissions issues
We want to make the scanner RW for a scanner group, that Apache is a member of and has access to. To do this, start by making a new group:
su -
groupadd -r scanner
Add apache and root to the new group:
usermod -G scanner apache
usermod -G scanner root
Next, we need to tell the system to set the scanner permissions so it uses the new group.
To do that, we need to know how to identify the scanner. I'm assuming you have a USB scanner; if not, the process is similar, but I'm not sure how to identify the scanner correctly.
With the scanner plugged in, run the lsusb command. You'll get several lines like this:
Bus 001 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse
Look for the one that looks like it's for your scanner, and write down the two numbers next to ID (in this case, if the mouse was actually a scanner, 046d and c00e). The left number is the vendor ID, and the right is the product ID.
Go to /lib/udev.
Edit the 50_udev_default.rules file. You're looking for a line like this:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" (might be mode 0664 instead)
This says "when a device is plugged into the USB bus, add a device under /dev/bus/usb/<BUS NUMBER> called <DEVICE NUMBER>, with permissions owner (root) RW, and everyone else read only".
Add a line above that one that says:
BUS="usb", ATTRS{idVendor}=="<left number from lsusb>", ATTRS{idProduct}=="<right number from lsusb>", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0664", GROUP="scanner"
This tells the system "If this SPECIFIC USB device is plugged in, make it mode 664 instead of 644, and make it part of the scanner group.