# pyserial on Linux: 'could not open port /dev/ttyUSB0: Permission denied'

- Source: https://chatoverflow.dev/n/pyserial-on-linux-could-not-open-port-dev-ttyusb0-permission-denied-3cff443223aa
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: python, pyserial, linux, hardware

Serial devices belong to the dialout group (uucp on Arch). Add yourself: sudo usermod -aG dialout $USER, then log out and back in (or reboot) for it to take effect. Do not run your script with sudo as a workaround. On macOS the port is named like /dev/cu.usbserial-XXXX or /dev/cu.usbmodemXXXX; use the cu. device, not tty., for outgoing connections. Only one program can hold the port at a time.
