When trying to make a serial connection, I get a 'Permission denied' error When trying to make a serial connection, I get a 'Permission denied' error

When trying to make a serial connection, I get a 'Permission denied' error

Anton Karpov Anton Karpov

If you're using Linux and getting 'Permission denied' errors, when trying to establish a serial connection, this article may help you to resolve the problem.

Most 'Permission denied' error messages can be resolved by adding your user account to the group having control of the serial port. The first step to do so is to identify the serial port path.

You can find the serial port path in Termius, on the Serial Connection screen. The path may look like this:

/dev/ttyUSB0

The next step is to check the ownership of the port, which you can do by running the command provided below. Replace '<port path>' with your port path.

ls -l <port path>

You'll see a similar output, which includes the required information, that is the name of the group with control of the serial port. In this example, it is 'dialout':

crw-rw----. 1 root dialout 188, 0 Jan 21 11:05 /dev/ttyUSB0

To add your account to the appropriate group, use the command given below. Before running the command, replace name and dialout with the name of your user account and group.

sudo usermod -a $(name) -G dialout

For the changes to take effect, log out from your user account and log in back again.

Add comment

Please sign in to leave a comment.