Serial port devices (ttyS*) unaccessible from non-root accounts

Bug #255200 reported by jhansonxi on 2008-08-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uucp (Ubuntu)

Bug Description

Binary package hint: udev

Currently, serial port devices (/dev/ttyS[0-3]) have 660 permissions and root.dialout ownership. This however is not enough for some serial communication applications to access the devices from a non-root account even if they are in the dialout group. Kermit, and reportedly cu and minicom are affected. Setting the permissions to 666 resolves the issue. I've attached my patch to the rules for setting 666 permissions but someone with expertise in this area needs to review the permissions, group assignment, and behavior of the applications to determine if this is the best solution. Other reports of the problem and various solutions:

jhansonxi (jhansonxi) wrote :

Place your user account, or that of the running daemon, in the dialout group

Changed in udev:
status: New → Invalid
jhansonxi (jhansonxi) wrote :

Next time read the report:

"This however is not enough for some serial
communication applications to access the devices from a non-root account
even if they are in the DIALOUT group."

jhansonxi (jhansonxi) on 2008-08-07
Changed in udev:
status: Invalid → New
Colin Watson (cjwatson) wrote :

I'd recommend getting an strace of the applications in question to figure out exactly which devices they're trying to access and what errors they're failing with.

From the point of view of a process in group dialout, 660 root:dialout and 666 root:dialout are precisely equivalent, so there is something more subtle happening here. Hitting it with 666 will no doubt resolve it for you but is not going to be the right answer for Ubuntu.

Colin Watson (cjwatson) wrote :

By the way, the most likely cause is that something is running setuid to a different user, or communicating with a process running as a different user - and in that case Scott's answer will still be accurate if you read it more closely ("or that of the running daemon").

jhansonxi (jhansonxi) wrote :

The archived Ubuntu forum thread I linked to above has an strace for cu. I continued the thread asking for assistance from other users here:

Tormod Volden (tormodvolden) wrote :

From looking at the forum postings the problem is that the users are running the applications as root. If you run cu as root it will change user to uucp which can not access the root:dialout port. cu is not setuid, so running it with a dialout user should work fine.

Please reopen if this does not work in Intrepid.

Changed in udev:
status: New → Invalid
Nicolas Jungers (unbug) wrote :

I'm running cu as root and cu doesn't work because it changes its UID to uucp instead of dialout. It is simple to change the owner and/or permissions of the devices I use, but the behaviour of cu is still a bug.

Tormod Volden (tormodvolden) wrote :

Nicolas, you are not meant to run cu as root. Does it work if you run cu as a normal user and this user is member of the dialout group?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers