0

I have trouble adding usb device to rules.d list, I want to be able to use it without root.

Here is my USB device:

Bus 001 Device 007: ID 1162:2200 Secugen Corp.

And this is entry I made in /etc/udev/rules.d/98-secugen-usb-device.rules:

SYSFS{idVendor}=="1162", SYSFS{idProduct}=="2200", SYMLINK+="input/fdu05-%k", MODE="0660", GROUP="SecuGen" KERNEL=="uinput", MODE="0660", GROUP="SecuGen"

I'm not quite sure what is SYMLINK+="input/fdu05-%k part, it was set as this in readme.txt.

Unfortunately this rule does not work. Usually it is quite straight forward, add vendorId/productId and it works, but not this time.

Any suggestions?

UPDATE: This is output I get from dmesg:

usb 1-1.1.3: new high-speed USB device number 12 using ehci-pci
usb 1-1.1.3: New USB device found, idVendor=1162, idProduct=2200
usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.1.3: Product: SecuGen USB U20
usb 1-1.1.3: Manufacturer: SecuGen Corp.

This is how my /dev/input looks like:

├── by-id
│   ├── usb-LITEON_Technology_USB_Multimedia_Keyboard-event-kbd -> ../event0
│   ├── usb-Microsoft_Comfort_Mouse_6000-event-mouse -> ../event1
│   └── usb-Microsoft_Comfort_Mouse_6000-mouse -> ../mouse0
├── by-path
│   ├── pci-0000:00:1a.0-usb-0:1.2:1.0-event-kbd -> ../event0
│   ├── pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse -> ../event1
│   ├── pci-0000:00:1a.0-usb-0:1.3:1.0-mouse -> ../mouse0
│   └── platform-pcspkr-event-spkr -> ../event4
├── event0
├── event1
├── event10
├── event2
├── event3
├── event4
├── event5
├── event6
├── event7
├── event8
├── event9
├── mice
└── mouse0

Log I get from unbuffer udevadm monitor --environment :

UDEV  [4656.200575] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3 (usb)
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/016
DEVNUM=016
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=SecuGen_USB_U20
ID_MODEL_ENC=SecuGen\x20USB\x20U20\x20\x20\x20\x20\x20\x20\x20
ID_MODEL_ID=2200
ID_REVISION=2206
ID_SERIAL=SecuGen_Corp._SecuGen_USB_U20
ID_USB_INTERFACES=:ffffff:
ID_VENDOR=SecuGen_Corp.
ID_VENDOR_ENC=SecuGen\x20Corp.\x20\x20\x20\x20
ID_VENDOR_FROM_DATABASE=Secugen Corp.
ID_VENDOR_ID=1162
MAJOR=189
MINOR=15
PRODUCT=1162/2200/2206
SEQNUM=1702
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=6
USEC_INITIALIZED=56185634

UDEV  [4657.235375] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0
DEVTYPE=usb_interface
ID_VENDOR_FROM_DATABASE=Secugen Corp.
INTERFACE=255/255/255
MODALIAS=usb:v1162p2200d2206dc00dsc00dp00icFFiscFFipFFin00
PRODUCT=1162/2200/2206
SEQNUM=1703
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=6
USEC_INITIALIZED=186134
adb_user=yes

Distro: Debian GNU/Linux 8 (jessie)

  • Sorry, did not make my problem clear. It just doesn't work. Usually it is quite straight forward, add vendorId/productId and it works, but not this time – somerandomusername Aug 28 '15 at 9:01
  • What distro are you doing this on? It won't work with systemd based distros. – roaima Aug 28 '15 at 10:17
  • Debian GNU/Linux 8 (jessie) – somerandomusername Aug 28 '15 at 10:21
  • Sorry. Game over. udev isn't used on Jessie. – roaima Aug 28 '15 at 10:39
  • So how do I add rules for my USB devices ? – somerandomusername Aug 28 '15 at 11:37
1

Hi and welcome to Unix & Linux StackExchange!

The only thing that you seem to be asking is the meaning of SYMLINK+="input/fdu05-%k" part in the udev rule. This tells udev to automatically create a symbolic link to your device under /dev/input/ with the name fdu05-<kernel name of the device>

But I understand that, since you mentioned that you don't want to be root to use the device, that's your main goal for this rule, right? If you see, the important part is the user rights part of the rule, that is, MODE and GROUP. For security reasons, leave the mode as 0660 (r/w permission to owner and group, but no others) and check that your user is part of the group "SecuGen". This can be checked easily running in the terminal

id <username>

If the user is not part of the group, add it running

# usermod -a -G <username> SecuGen

Of course, you can also change the rule so that GROUP has your desired user's group.

Finally, remember to restart udev whenever you change any rule, or, if you have udevadm, you can ask udev to reload the rules running

# udevadm control --reload-rules

Good luck!

  • Thank You for response. I'm checking for /dev/input to see if it has created symlink, but it doesn't have any corresponding entry pastebin.com/raw.php?i=CRxec9Un . It should be in "input" directory, perhaps I should create it? – somerandomusername Aug 28 '15 at 9:41
  • have you restarted udev and reattached the device to trigger the rule? No, you should not alter the contents of /dev directory. – dave_alcarin Aug 28 '15 at 9:55
  • Yes, I reloaded rules and reattached the device, even did full system restart. But nothing new appeared under /dev/input – somerandomusername Aug 28 '15 at 9:57
  • Check the kernel logs with dmesg to see what is going on when you attach the device. You could also try and change the symlink in the rule so that it creates the link directly under /dev. Also, I might ask... is the device an input device? If not, it would be quite senseless to have it under the "input" directory anyway... – dave_alcarin Aug 28 '15 at 10:01
  • Yes it is input device (fingerprint reader). This is output I get from dmesg : pastebin.com/raw.php?i=84tbpdRJ – somerandomusername Aug 28 '15 at 10:04
1

You've got this rule

SYSFS{idVendor}=="1162", SYSFS{idProduct}=="2200", SYMLINK+="input/fdu05-%k", MODE="0660", GROUP="SecuGen" KERNEL=="uinput", MODE="0660", GROUP="SecuGen"

The SYMLINK entry adds a symlink for the device to /dev/input/fdu05-%k, where %k is replaced by the kernel name for this device. (You can see this in the man page for udev(7).)

You have two GROUP definitions; only one is expected.

Do you have the Linux group "SecuGen" defined? You can run getent group SecuGen to see if it's defined, or on a simple system just look in /etc/group. If not you'll need to add it so that the rule can set the device to that group.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.