Why do my permissions on /dev/ttyACM0 reset after every reboot?
Asked by
0b1011flip
I'm running CachyOS and use a 3D-printer program that communicates through /dev/ttyACM0. The program only works after I run chmod with sudo to change the device permissions, but I have to repeat that every time I start the computer. The printer normally stays powered on and connected, although the computer is shut down overnight. Shouldn't the permission change persist like it would for a regular file? What's the proper long-term fix?
Answers
The device file is managed by udev and its permissions are set whenever the printer is detected. Adding your user to the deviceโs group is usually enough. If the default udev settings donโt work for your printer, create a custom udev rule matching its USB vendor and product IDs, then assign the desired group and mode there.
Reply to this answer
That device path is created by udev in /dev, which is generally a temporary device filesystem. When the machine rebootsโor the device is unplugged and detected againโthe device node is recreated, so manual chmod changes disappear. The better fix is to use the permissions udev assigns automatically rather than changing the node by hand.
Reply to this answer
Check which group owns the device with something like `ls -l /dev/ttyACM0`. Serial devices are commonly assigned to a group such as `dialout`, `uucp`, or `modem`. On CachyOS, `uucp` may be the relevant group. Add your account to the appropriate group, for example `sudo usermod -aG uucp $USER`, then log out and back inโor rebootโfor the new membership to take effect. You usually shouldnโt need chmod afterward.
Reply to this answer
Add your answer
Answers are reviewed before publication.
8 chess puzzles: You could run the chmod command automatically at startup, but a udev rule or the correct user group is more reliable because it also handles the device being recreated after reconnecting the USB cable.