You are not logged in.

#1 2011-09-24 08:37:53

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Changing Default Permissions on /dev/ttyUSB0

I have a serial to usb converter, which I use to access a Garmin eTrex. By default this is mounted with the following permissions:


crw-rw---- 1 root uucp 188, 0 Sep 24 09:25 /dev/ttyUSB0

I would like to be able to access the device as a user. Adding myself to the uucp group doesn't work. I have vague memories of using custom udev rules to do this. Can anyone point me in the right direction?

Ian.

Offline

#2 2011-09-24 19:51:49

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Changing Default Permissions on /dev/ttyUSB0

You should have rw permissions if you are in the uucp group. Did you re-login after adding yourself to that group?

Offline

#3 2011-09-24 22:15:49

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,737
Website

Re: Changing Default Permissions on /dev/ttyUSB0

Um, that isn't a mount point. That's a device node.

I have no experience with ttyUSB device nodes, but presumably you can mount it with mount:

# mount /dev/ttyUSB0 /mnt

or with udisks:

$ udisks --mount /dev/ttyUSB0

Depending on what filesystem it uses, you might need to declare file permissions at mount time (if it uses NTFS or FAT, you will need to); you can usually do this by using the following to the mount command:

mount -o "uid=1000,gid=100,umask=002" /dev/ttyUSB0 /mnt

Note: you don't need to add anything to udisks command, if necessary, it should automatically mount the file system as your user.

EDIT: Just checked up on what an eTrex is, and I have no experience with GPS devices either, so this information may not be relevant. tongue

Last edited by WorMzy (2011-09-24 22:19:36)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2011-09-25 07:54:25

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: Changing Default Permissions on /dev/ttyUSB0

Thanks, I had logged back out after adding myself to the uucp group. If I chown ina.users /dev/ttyUSB0 I can access the device OK. However, when I reboot permissions are reset to root.uucp.

I have also tried creating a custom udev rule:

nano /etc/udev/rules.d/50-udev-default.rules'

which contains:

  SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_deviceNAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666"

but still no luck. On an Ubuntu system I can access the device as a normal user. I'll have a poke around on the Ubuntu box and see if the have any relevant custom udev rules.

Offline

#5 2011-09-26 09:50:51

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: Changing Default Permissions on /dev/ttyUSB0

Finally solved this with the following udev rule (thanks to a Fedora post somewhere else):

# serial
KERNEL=="tty[A-Z]*|pppox*|ircomm*|noz*", GROUP="uucp", MODE="0666"

Offline

Board footer

Powered by FluxBB