Sanity、udevルールを追加してもsudoを使用しないとスキャナが見つかりません(権限の問題)

Sanity、udevルールを追加してもsudoを使用しないとスキャナが見つかりません(権限の問題)

私のAIOプリンタ/スキャナはCanon E400ですが、通常のユーザーとして私のスキャナを見つけることができません。 sudo&scan または sudo のみ使用できます。

~ cincinmasukmangkok@orangepizero
< sane-find-scanner                                                                                                       <<<

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

could not open USB device 0x1d6b/0x0001 at 008:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 005:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 007:001: Access denied (insufficient permissions)
could not open USB device 0x04a9/0x177a at 004:007: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 004:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 006:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 003:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 002:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 001:001: Access denied (insufficient permissions)
  # No USB scanners found. If you expected something different, make sure that
  # you have loaded a kernel driver for your USB host controller and have setup
  # the USB system correctly. See man sane-usb for details.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.

~ cincinmasukmangkok@orangepizero
> scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

~ cincinmasukmangkok@orangepizero
< sudo sane-find-scanner                                                                                                  <<< [sudo] password for cincinmasukmangkok:

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x04a9 [Canon], product=0x177a [E400 series]) at libusb:004:007
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

~ cincinmasukmangkok@orangepizero
< sudo scanimage --format=png > test.png                                                                                  <<<

~ cincinmasukmangkok@orangepizero 33s
>

また、/lib/udev/rules.d/60-libsane.rulesに追加しましたが、まだ機能しません。

SUBSYSTEM=="usb", ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="177a", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

答え1

この行を追加してこの問題を解決してください。/lib/udev/rules.d/10-local.rules

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="177a", MODE="0666"

答え2

scanner、、にアカウントを追加しましたlpsanedしかし、それだけでは役に立ちません。これらのルールファイルがないので、私のソリューションはsudo chmod -R a+w /dev/bus/usb。その後、sane-find-scanner通常のユーザーアカウントを使用して検索できることを確認できます。

rc.localその後、次の内容を含むファイルを追加/作成しました。

#!/bin/sh -e
chmod -R a+w /dev/bus/usb
exit 0

それから私はそれを設定しましたsudo chmod +x rc.local

関連情報