You are not logged in.

#1 2009-12-03 16:29:40

Session
Member
Registered: 2008-06-23
Posts: 34

Permission to /dev/ttyUSB0

Hi, I am trying to get permission to /dev/ttyUSB0

ls -l /dev/tty* gives me

crw-rw---- 1 root uucp 188,  0 2009-12-03 17:25 /dev/ttyUSB0

groups session (my username) gives me

wheel network video audio optical storage users uucp mpd

I can't find the problem.

Login as root and there is no problem at all?

hmm

Offline

#2 2009-12-13 08:42:26

Session
Member
Registered: 2008-06-23
Posts: 34

Re: Permission to /dev/ttyUSB0

bump

Offline

#3 2009-12-23 15:32:32

DC
Member
From: Australia
Registered: 2009-12-23
Posts: 1

Re: Permission to /dev/ttyUSB0

I just had to work this out so that I could connect with my 3G modem (which uses /dev/ttyUSB0) without having to login as root (or sudo or su). I needed a udev rule.
First, I copied /lib/udev/rules.d/50-udev-default.rules to /etc/udev/rules.d/50-udev-default.rules since I didn't have a copy there to start with. According to the udev man pages, the rules in /lib are the system defaults, while the ones in the /etc subfolder are customised ones.

Then after the rule for serial devices I added a specific rule just for ttyUSB0 with relaxed permissions:

# serial
# this is the general rule that covers ttyUSB0 among others
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp"

# relax the permissions just for ttyUSB0
KERNEL=="ttyUSB0",              MODE="0666"

After that I just needed to unplug the modem and reconnect it, so that udev could recreate the device with the new permissions.

Doing this means I didn't have to add my normal user to the uucp group since I have read that doing so creates security issues. But then giving everyone rw access to ttyUSB0 probably creates security issues as well.

Hope that helps.
DC

Offline

Board footer

Powered by FluxBB