智能卡設備的所有權在Xen虛擬機(內QubesOS),我可以看到我的手,通過USB智能卡讀卡器這樣的:未能使用udev規則改變的Xen/QubesOs VM
Prompt> lsusb
Bus 002 Device 002: ID 04e6:5116 SCM Microsystems, Inc. SCR331-LC1/SCR3310 SmartCard Reader
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
展望與udevadm
產量更深:
Prompt> udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/002)
looking at device '/devices/platform/vhci_hcd/usb2/2-1':
KERNEL=="2-1"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{authorized}=="1"
ATTR{avoid_reset_quirk}=="0"
ATTR{bConfigurationValue}=="1"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bMaxPacketSize0}=="32"
ATTR{bMaxPower}=="100mA"
ATTR{bNumConfigurations}=="1"
ATTR{bNumInterfaces}==" 1"
ATTR{bcdDevice}=="0204"
ATTR{bmAttributes}=="a0"
ATTR{busnum}=="2"
ATTR{configuration}=="CCID Class"
ATTR{devnum}=="2"
ATTR{devpath}=="1"
ATTR{idProduct}=="5116"
ATTR{idVendor}=="04e6"
ATTR{ltm_capable}=="no"
ATTR{manufacturer}=="SCM Microsystems Inc."
ATTR{maxchild}=="0"
ATTR{product}=="SCR3310 v2.0 USB SC Reader"
ATTR{quirks}=="0x0"
ATTR{removable}=="unknown"
ATTR{speed}=="12"
ATTR{urbnum}=="14"
ATTR{version}==" 2.00"
looking at parent device '/devices/platform/vhci_hcd/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
...
儘管權限被設置爲事實如下:
Prompt> ls -la /dev/bus/usb/002/002
crw-rw-r-- 1 root root 189, 129 May 3 23:01 /dev/bus/usb/002/002
致電gpg2 --card-status
的結果爲root
,但正常用戶產生Card error
。 我嘗試用以下udev
規則(/etc/udev/rules.d/51-SCR3310.rules
)來解決這個問題:
KERNEL=="usb*", SUBSYSTEM=="usb", ATTRS{idVendor}=="04e6", ATTRS{idProduct}=="5116", MODE="0660", GROUP="user"
但無論我做什麼,我不能讓普通用戶通過gpg2
訪問讀卡器。
我在哪裏搞砸了?