1. Home
  2. Docs
  3. Python 3.X Documentation
  4. Troubleshooting
  5. Access denied when attempting to open a serial port connection in a Linux Host

Access denied when attempting to open a serial port connection in a Linux Host

If you get a message similar to

Cannot open /dev/ttyUSB0: Permission denied

when attempting to use the Python 3 serial_connection module, your account might not have the necessary permissions to open serial ports.

To solve this, add your account to the groups with the necessary permissions by executing these commands below:

sudo usermod -a -G dialout $USER
sudo usermod -a -G tty $USER

A reboot is required after executing these commands.