How to Set Camera Device Permissions in Linux with chmod
Learn how Linux webcam permissions work, when chmod helps, why its changes don't persist, and the safer fix: video group membership or a udev rule.
Short answer: you can run chmod on your webcam's device file, usually /dev/video0, to change who can open it. The change is temporary, though. Device files under /dev are recreated every time the system boots or the camera is unplugged and reconnected, and that resets the permissions you set. chmod is useful for a quick test. For a lasting fix, add your user to the group that owns the device (commonly video), or write a udev rule. Avoid making the camera readable and writable by everyone, because that lets any local user or process capture video.
Two conditions change this answer. If the camera doesn't appear under /dev at all, permissions are not the problem; the device isn't being detected. If the app is sandboxed (for example, a Flatpak or Snap package) or runs in a browser, the sandbox or browser has its own permission layer, and chmod won't affect it.
How Linux controls access to a webcam
On Linux, most USB and built-in webcams are handled by the Video4Linux (V4L2) subsystem. Each camera appears as a character device file such as /dev/video0, and some cameras create more than one node. Access is governed by the same three permission sets as any other file: owner, group and others. Each set can have read and write permission, and an application needs both to capture video.
Many distributions make root the owner and video the group, giving read and write access to the owner and the group but nothing to others. Many desktop systems also use systemd-logind to grant the person logged in at the physical console extra access through an access control list (ACL). That's why a camera can work for your desktop session even if you aren't in the video group. The details vary by distribution and setup, so check your own system instead of assuming a particular default.
Check what you have before changing anything
Work through these checks in order. Each one rules out a different cause.
- 1. Detection: confirm the camera exists as a device file.
- 2. Permissions: see who owns it and what access the group and others have.
- 3. Your account: confirm which groups your user belongs to.
- 4. ACLs: see whether your session has been granted access separately.
- 5. Selection: confirm the application is using the right device.
# 1. Is the camera detected?
ls -l /dev/video*
v4l2-ctl --list-devices # provided by the v4l-utils package
# 2 and 4. Ownership, mode and any ACL entries
ls -l /dev/video0
getfacl /dev/video0
# 3. Your groups
groups
In the output of ls -l, a line beginning with crw-rw---- followed by root video means the file is a character device (c), the owner and group can read and write, and others can't. If your user isn't in that group and getfacl shows no entry for your username, applications you run won't be able to open the camera.
If ls reports that no such file exists, stop here. The issue is detection, not permissions. Typical causes include a missing driver, a loose cable, or a privacy switch or hardware key that disables the camera.
Using chmod as a temporary test
chmod changes a file's mode, meaning its permission bits. On a device file, you need root privileges to do this. To quickly confirm that permissions are the cause, you can briefly grant read and write access to others, test the camera, and then revert:
# Temporarily allow any user to read and write the camera (for testing only)
sudo chmod o+rw /dev/video0
# Test the camera in your application, then remove that access again
sudo chmod o-rw /dev/video0
If the camera works after the first command, you've confirmed a permission problem. Don't leave it that way. With access open to others, any account or background process on the machine can record from the camera. Running chmod 666 or chmod 777 on the device has the same risk. The setting also won't survive a reboot or reconnection, so it isn't a real fix anyway.
The lasting fix: join the device's group
Instead of changing the device's mode, give your account membership in the group that already has access. Use the group name shown by ls -l. It's often video, but confirm it on your system.
sudo usermod -aG video "$USER"
The -a flag matters. It appends the group to your existing ones. Without it, usermod replaces your supplementary groups, which can remove access you rely on, such as administrator rights. Group changes take effect at your next login, so log out and back in (or reboot), then run groups to confirm. Membership is per account, so you grant access only to the users who need it.
When you need custom permissions: a udev rule
udev is the service that creates device files and sets their owner, group and mode. If you need a specific group or mode that persists, define it in a udev rule rather than with chmod. The example below sets every V4L2 device to group video with read and write access for owner and group only:
# /etc/udev/rules.d/99-webcam.rules
SUBSYSTEM=="video4linux", GROUP="video", MODE="0660"
# Apply the rule without rebooting
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=video4linux
After you trigger the rule, run ls -l /dev/video0 again to confirm the change. Your distribution may already ship rules for the same devices. If your setting doesn't apply, a rule that runs later may be overriding it. Rule files are processed in order by filename, which is why custom rules often use a high number prefix.
Permissions look right, but the camera still fails
If the device exists and your account can access it, the remaining causes usually lie outside file permissions:
- Wrong input selected: a camera can create several /dev/video nodes, and not all of them provide a video stream. Choose the correct camera in the application's settings, or use v4l2-ctl --list-devices to see which nodes belong to which camera.
- Device busy: if another program is already using the camera, a second program may be refused. That error isn't a permission problem.
- Sandboxed apps: Flatpak and Snap applications get camera access through their own permission systems, such as portals or interface connections. Grant access there.
- Browsers: websites need permission from the browser itself, separate from Linux file permissions. Check the site's camera permission in your browser.
Microphones are a separate device
Changing permissions on /dev/video* affects video capture only. Microphones are handled by the sound subsystem, usually through ALSA devices under /dev/snd. On most current desktops, applications reach them through a sound server such as PipeWire or PulseAudio rather than opening the devices directly. If your camera works but the microphone doesn't, check whether the microphone is detected, whether the correct input is selected in your sound settings and the application, and whether any app or browser permission is blocking it. Don't change the sound devices' permissions with chmod as a first step.
What this guide can't confirm
No evidence specific to your distribution, camera model or software versions was available for this article. Default owners, group names, ACL behavior and existing udev rules differ between distributions and releases. Treat the commands above as general Linux practice, and check the actual output on your own machine before changing anything.