The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
    • Troubleshooting
        • Recover an interrupted freebsd-update run
        • Resolve a package repository or ABI mismatch
        • Diagnose the FreeBSD boot path
        • Recover with a ZFS boot environment
        • Diagnose DNS, routing, and firewall paths
        • Diagnose network mbuf exhaustion
        • Bind a service to a low port without running it as root
        • Diagnose audio output or input
        • Diagnose webcamd, cuse, and a webcam
        • Fix USB device permissions without opening every device
    • About this handbook
    • Synopsis
    • Identify the failed layer
    • Prefer an existing device policy
    • Understand persistent devfs configuration
    • Apply one local ruleset
    • Keep raw USB access exceptional
    • Report useful evidence
    • Primary references

    Fix USB device permissions without opening every device

    Last reviewed
    13 August 2026
    Applies to
    15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

    Synopsis #

    USB attachment and device permission are different events. A device can appear in usbconfig while its application-facing node remains unreadable to the login. A manual chmod is temporary because devfs recreates nodes after detach, reattach, and reboot.

    Use the group and device-node policy documented by the driver or package whenever one exists. If a local devfs rule is necessary, match the narrowest application-facing node and grant only the required group. Do not make /dev/usb/*, /dev/ugen*, or all input devices world-writable.

    Identify the failed layer #

    List USB devices and recent attachment messages:

    $ usbconfig list
    $ dmesg | tail -100
    

    Identify the kernel driver and the node opened by the application. Examples include a serial node under /dev/cuaU*, a camera node under /dev/video*, or an input node under /dev/input/. The raw ugen identity is not necessarily the node the application should open.

    Inspect the node and the login’s groups:

    $ ls -l /dev/device-node
    $ id
    

    Substitute the real node. Preserve the exact permission-denied message from the application. If the node does not exist, permissions are not yet the problem; return to driver attachment or the service that creates it.

    Prefer an existing device policy #

    Read the driver manual page and package documentation before inventing a group. Common policies include:

    • the webcamd group for nodes created by webcamd;
    • an application-specific group created by a package;
    • operator for administrative storage or virtualization workflows documented by FreeBSD;
    • games for game-controller event access documented by current HID drivers.

    These groups can grant access beyond one device. Inspect the group’s purpose and existing devfs rules before adding a login:

    $ pw groupshow groupname
    # pw groupmod groupname -m loginname
    

    Substitute the documented group and intended login. Start a new login session and verify with id; supplementary groups do not update inside existing sessions.

    For cameras, follow the webcamd and cuse guide instead of adding a parallel raw-USB rule.

    Understand persistent devfs configuration #

    /etc/devfs.conf applies boot-time ownership and modes to devices available at boot. Its manual page explicitly directs hotplug devices to devfs.rules. USB device nodes can be destroyed and recreated, so a successful manual chown or chmod is only a diagnostic test.

    A devfs ruleset has this structure:

    [localrules=10]
    add path 'device-node-pattern' mode 0660 group devicegroup
    

    This is a template, not a literal rule. Replace both placeholders. The pattern is relative to /dev and should match only the required application-facing node class. Mode 0660 gives the owner and selected group read/write access without opening the node to every login.

    Before using a wildcard, list every node it currently matches and consider devices that it could match later. A broad input/event* rule, for example, can expose keyboards as well as the intended controller.

    Apply one local ruleset #

    Inspect existing local definitions and the selected system ruleset:

    # sed -n '1,240p' /etc/devfs.rules
    $ sysrc devfs_system_ruleset
    

    Merge the narrow rule into the existing locally named ruleset. Do not create a second ruleset with the same number or replace package-provided rules accidentally.

    When localrules is the reviewed ruleset name, select it and reapply devfs configuration:

    # sysrc devfs_system_ruleset=localrules
    # service devfs restart
    

    Recheck the node mode, then detach and reattach the USB device and check it again:

    $ ls -l /dev/device-node
    

    The reattachment test is important. A rule that works only for the current node instance is not a persistent hotplug policy.

    Keep raw USB access exceptional #

    Raw USB nodes can permit control transfers that exceed the application’s ordinary needs. Granting a desktop login access to every raw USB bus node broadens the effect of a compromised application or browser. Treat a project’s request for raw access as a security decision:

    1. Confirm that no kernel driver exposes a narrower node.
    2. Confirm the exact node pattern and required operations in upstream documentation.
    3. Use a dedicated group with only the intended logins.
    4. Avoid 0666 and blanket ugen* or usb/* rules.
    5. Recheck the rule after adding new USB device classes to the system.

    Storage permissions require additional caution. Allowing a login to write a raw disk can destroy filesystems, and allowing untrusted users to mount arbitrary filesystems creates a separate security boundary. Follow the FreeBSD storage chapter instead of generalizing a peripheral rule to disks.

    Report useful evidence #

    A permission report should include:

    • FreeBSD release and architecture;
    • usbconfig list entry and relevant attachment messages;
    • attached driver and application-facing node;
    • node owner, group, and mode before the change;
    • login groups from a fresh session;
    • the exact devfs rule and every path it matches;
    • the result after detach and reattach.

    This evidence distinguishes a missing driver, an incorrect package policy, and an overly narrow or overly broad local rule.

    Primary references #

    • devfs(8)
    • devfs.rules(5)
    • devfs.conf(5)
    • usbconfig(8)
    • pw(8)
    • FreeBSD Handbook: USB storage devices

    Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

    Report a bug
    • Synopsis
    • Identify the failed layer
    • Prefer an existing device policy
    • Understand persistent devfs configuration
    • Apply one local ruleset
    • Keep raw USB access exceptional
    • Report useful evidence
    • Primary references