I am reading up on udev, about its purpose, history and implementation. I have read the Wikipedia article and next I’m going to read the man pages. Meanwhile, I watched this video (Invidious link here) to see an example of what udev rules can do. I just have some questions regarding this video specifically:

  1. Following the principle of least privilege, shouldn’t I create a separate group - usb or whatever - rather than using wheel this way, which gives it double roles?
  2. Why don’t I just chmod and chown the /dev file(s) in question, if udev already provides persistent device naming (=the raw device won’t have a different designation at next disconnect-connect)? Or does the designation change perhaps?
  • eldavi@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    6 days ago

    you’re going to learn it better than 90% of people out there if you do all of this. lol

  • GaumBeist@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    6 days ago
    1. Yes… in my opinion. The real answer is that it depends on the intended use of the system and the users’ needs. It’s as legitimate to treat wheel as a catchall permissions group as it is to go around specifying permissions for specific users in your sudoers and udev rules

    2. From my understanding, the kernel tends to reuse the same names when attaching devices, but it’s not required to do so by the specs (i.e. there may be cases where the /dev file name changes depending on what you have plugged in). Hence why the common advice is to not specify /dev files in your fstab, and why people use udev rules instead of chmod and chown-ing the /dev files

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 days ago

      Thanks!

      1. I’m going to interpret this as such: it doesn’t really matter, since - on my system - creating new groups require root privileges, requiring a superuser or a user part of wheel anyway. This way, I can create a group with name that reflects its purpose, which in turn gives readability to the udev rule file.

      2. This makes sense. Thanks for the fstab example/reminder!