problem
When I tried to run the USB GPS receiver in Linux, I encountered the following error from GPSD. It appears that GPSD does not have access to the USB device (/dev/ttyusb0). How do I permanently modify its permissions on Linux?
Solution Solutions
When you run a process that reads or writes to a USB device, the user/group of the process must have permission to do so. Of course you can manually change the USB device permissions with the chmod command, but the manual permission change is only temporary. The USB device will restore its default permissions on the next reboot.
As a permanent way, you can create a Udev-based USB permission rule that can be assigned any permission mode based on your choice. Here's how to do it.
1. Use the LSUSB command to find the VendorID and ProductID of the USB device
$ lsusb-vvv
In the above LSUSB output, locate your USB device and find the "Idvendor" and "idproduct" fields. In this example, our results are Idvendor (0x067b) and idproduct (0x2303)
2. Create a new Udev rule
$ sudovi/etc/udev/rules.d/50-myusb.rules
Replace the default values with your own "Idvendor" and "idproduct". Mode= "0666" indicates the permissions of the USB device.
subsystems== "USB", attrs{idvendor}== "067b", attrs{idproduct}== "2303", group= "users", mode= "0666"
3. Restart your computer or reload Udev rules
$ sudo udevadm control--reload
Verify the permissions on the USB device:
Free to provide the latest Linux technology tutorials Books, for open-source technology enthusiasts to do more and better: http://www.linuxprobe.com/
Permanently modify USB device permissions in Linux