Ubuntu udev rules 设置方法
2015-02-08 08:54
225 查看
还是国外资料有用,需要在Linux(Ubuntu)普通用户下访问原本要在root下才能访问的usb设备可以参考本文。 SUBSYSTEMS=="usb",ATTRS{idProduct}=="xxxx",ATTRS{idVendor}=="xxxx",MODE="666",OWNER=“xxxx",GROUP="xxxx" 原文:http://pigeonsnest.co.uk/stuff/ubuntu-udev-scanner.html ; Ubuntu: udev rules for USB scanner How to create a udev rule to get a USB scanner working in Ubuntu jaunty. Assumes that: (1) user is a member of group "scanner", (2) sane is installed. Symptoms of problem: "sane-find-scanner" detects the existence of the scanner, but "scanimage -L" does not report it when run with user permissions, only when run with root permissions. Scanning works as root, but not as a normal user. 1) Run "lsusb" to find the scanner's manufacturer and device IDs. Example output: $ lsusb Bus 003 Device 014: ID 04b8:012e Seiko Epson Corp. Bus 003 Device 012: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button) Bus 003 Device 011: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 013: ID 04b8:0005 Seiko Epson Corp. Stylus Printer Bus 001 Device 001: ID 0000:0000 $ In the above example, the first line relates to the scanner... in this case an Epson Perfection V200... it is somewhat unhelpful that this particular scanner's text ID string is nothing more than "Seiko Epson Corp.", but it is easy to determine that that device is indeed the scanner by running "lsusb" both with and without the scanner plugged in. The four-digit hex number "04b8" is the manufacturer ID (observe that the Epson printer on the penultimate line has the same manufacturer ID), and "012e" is the device ID. 2) Create a file /etc/udev/rules.d/40-scanner.rules containing the following (your browser may have wrapped this; it should be all on one line): SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012e", ENV{libsane_matched}="yes", GROUP="scanner" Of course you will substitute the appropriate values for your scanner, obtained from "lsusb", for the idVendor and idProduct entries. The SUBSYSTEMS and ATTRS entries have double == signs whereas the ENV and GROUP entries have single = signs. This is not a typo. 3) Restart udev: $ sudo /etc/init.d/udev restart * Stopping kernel event manager... [ OK ] * Starting kernel event manager... [ OK ] $ 4) Unplug the scanner and plug it in again. 5) Check that it has obtained the correct permissions. Run "lsusb" again to determine the bus and device IDs - they will have changed due to the unplugging and replugging. Then check the appropriate device node in /dev/bus/usb: $ lsusb Bus 003 Device 015: ID 04b8:012e Seiko Epson Corp. Bus 003 Device 012: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button) Bus 003 Device 011: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 013: ID 04b8:0005 Seiko Epson Corp. Stylus Printer Bus 001 Device 001: ID 0000:0000 $ ls -l /dev/bus/usb/003/015 crw-rw-r-- 1 root scanner 189, 269 Apr 24 19:10 /dev/bus/usb/003/015 $ If the output corresponds with the above, all should be well, and running "scanimage -L" with user permissions should now pick the scanner up: $ scanimage -L device `epkowa:libusb:003:015' is a Epson Perfection V200 flatbed scanner $ Note that the V200 requires a driver; this document does not cover that, only the setting of the permissions. |
相关文章推荐
- Ubuntu adb devices :???????????? no permissions (verify udev rules) 解决方法
- ubuntu设置locale方法[转]
- ubuntu7.10下使用QQ聊天-wine+QQ2007安装设置方法
- [多图] Ubuntu 中开启3D桌面特效与设置方法
- ubuntu设置locale方法
- Ubuntu设置环境变量错误导致系统无法登录解决方法 [转]
- 超简单的Ubuntu7.04下的字体安装方法,包括雅黑字体设置方法。
- ubuntu 自添加开机启动程序(一种使ethtool设置永久保存在网络设备中的曲线救国方法) 转自:http://www.groad.net/bbs/read.php?tid-1393.html
- Ubuntu设置环境变量错误导致系统无法登录解决方法
- Ubuntu设置静态IP的方法
- ubuntu面板恢复默认设置方法
- ubuntu全局代理设置方法
- ubuntu 源(7.04)设置的正确方法
- 给Ubuntu 8.10 的 3D桌面不同桌面设置不同壁纸的方法
- 虚拟机Ubuntu上网设置方法
- Ubuntu 7.10 库中的 Apache2 主目录新设置方法
- [多图] Ubuntu 8.04 中开启3D桌面特效与设置方法
- thinkpad X61之我的降温方法(付TRACKPOINT的设置)[转ubuntu论坛]
- ubuntu设置ASDL转DHCP的方法
- Ubuntu中安装samba服务器创建文件共享的方法及普通用户设置共享的问题解析