Only root can mount USB to serial adapter
Hi! I have a strange problem here.
System info: OS: Ubuntu 14.04 i686
.-- -++++++++/-.-::-` Kernel: 3.13.0-30-generic
I (normal user) can mount anything through USB without any problems, external harddrives, memory sticks, even tablets and phones work like a charm. But my USB to serial adapters are not. For them to work I have to go into root mode (sudo su) then I can reach it through either putty or gtkterm. Any idea how I can mount it as a normal user and not through root?
dmesg output:
[14254.086791] usb 2-3.4: FTDI USB Serial Device converter now attached to ttyUSB0
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Creating a UDEV rule for changing protection settings on the device when plugging it in maybe can help
Revision history for this message
|
#2 |
Hi, would appreaciate if you explained further more in detail please? Doesn't tell me anything unfortunately
Revision history for this message
|
#3 |
You wrote that you can access that device only as root user, so I assumed that there are access rights restrictions that prevent working with that device for normal users. Changing the access rights to allow access for everyone might solve your problem.
Whenever you plug in a new device (or remove it), the udev demon performs certain actions (depending on type of device, and configured in so-called udev rules). It is possible to write an udev rule to change the device protection settings when your serial adapter is plugged in, and when my assumption is correct, this should allow you to use that as normal user.
Based on the instructions in http://
Open a terminal (e.g. by simultaneously pressing ctrl-alt-t) and do the following:
Make sure the serial adapter is plugged in and issue the commands
ls -l /dev/usb/ttyUSB0*
for DEVICE in $(find /sys ! -type l -iname "*ttyUSB0*"); do ls -dl $DEVICE; udevadm info -a -p $DEVICE; done
Finally copy/paste all output into this question document.
Revision history for this message
|
#4 |
Hi again,
first output:
arve@arve-
arve@arve-
find: `/sys/fs/
find: `/sys/kernel/
drwxr-xr-x 4 root root 0 juli 10 21:01 /sys/devices/
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/
KERNEL=
SUBSYSTEM=
DRIVER=
ATTR{
ATTR{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="2-4"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="usb2"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS==""
DRIVERS==""
drwxr-xr-x 3 root root 0 juli 10 21:01 /sys/devices/
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/
KERNEL=
SUBSYSTEM=
DRIVER==""
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="2-4"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="usb2"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS==""
DRIVERS==""
arve@arve-
arve@arve-
arve@arve-
find: `/sys/fs/
find: `/sys/kernel/
drwxr-xr-x 4 root root 0 juli 10 21:01 /sys/devices/
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/
KERNEL=
SUBSYSTEM=
DRIVER=
ATTR{
ATTR{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="2-4"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="usb2"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS==""
DRIVERS==""
drwxr-xr-x 3 root root 0 juli 10 21:01 /sys/devices/
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/
KERNEL=
SUBSYSTEM=
DRIVER==""
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="2-4"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=="usb2"
SUBSYSTEMS=
DRIVERS=="usb"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS==""
DRIVERS==""
Revision history for this message
|
#5 |
ok, your output seems to confirm my assumption:
drwxr-xr-x 4 root root 0 juli 10 21:01 /sys/.../ttyUSB0
Only root is allowed writing to that device.
Taking http://
SUBSYSTEM(
ATTRS{idVendor}
ATTRS{idProduct
or (using the instructions for ttyS0 in that document)
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty" or SUBSYSTEMS=
To get an indication, which of the variants would be better, can you please provide the output of the following command (with the USB Serial converter plugged in)
find /dev -name '*ttyUSB0*' -exec ls -la {} \;
Revision history for this message
|
#6 |
arve@arve-
crw-rw---- 1 root dialout 188, 0 juli 11 09:14 /dev/ttyUSB0
find: `/dev/vboxusb': Permission denied
Revision history for this message
|
#7 |
Why didn't I ask for that output earlier? I think you can forget all of the above, there should not be the need for another udev rule. Just adding yourself to the group dialout should be sufficient.
sudo adduser arve dialout
logoff and logon again and try using the serial adapter.
Revision history for this message
|
#8 |
Hehehe had I known the answer to that I wouldn't have asked the question in the first place :-D
So far so good, not getting the error I did before, I'll test this at work tomorrow and let you know.
Thanks so far!
//Arve
Revision history for this message
|
#9 |
Problem solved, it works just fine now :-) Thank you!!
//Arve
Revision history for this message
|
#10 |
Btw I have same issue in Virtualbox whereas I can't load any type of USB, guest OS is Win7 but no USB is detected through the virtualbox application either. And I saw in one of my outputs here earlier the following:
arve@arve-
crw-rw---- 1 root dialout 188, 0 juli 11 09:14 /dev/ttyUSB0
find: `/dev/vboxusb': Permission denied
I reckon this is also due to a permission issue. I tried your suggestion above with "find" and the rest but replaced ttyUSB0 with vboxusb but no such thing was found. Suggestions?
Revision history for this message
|
#11 |
I am no expert for virtualbox issues, just two ideas:
Do you have the virtualbox guest additions installed (with the correct version)?
What is the output of "ls -la /dev/vboxusb" (for checking whether there is another group where you maybe have to be member).
Revision history for this message
|
#12 |
Hi!
ls -la /dev/vboxusb
ls: cannot open directory /dev/vboxusb: Permission denied
Guest additions installed and working correctly, all other functions are working so I am very sure this is a permission thing again :-)
Revision history for this message
|
#13 |
Sorry, of course
sudo ls -la /dev/vboxusb
Revision history for this message
|
#14 |
sudo ls -la /dev/vboxusb
[sudo] password for arve:
total 0
drwxr-x--- 3 root vboxusers 60 juli 12 13:16 .
drwxr-xr-x 17 root root 4300 juli 13 18:19 ..
drwxr-x--- 2 root vboxusers 100 juli 12 13:18 002
arve@arve-
Revision history for this message
|
#15 |
Are you member of the vboxusers group?
If not,
sudo adduser arve vboxusers
logoff, logon and try again.
Revision history for this message
|
#16 |
You are a genius! Thanks a million :-) :-)
Hope I can help you with something another time :-)
//Arve
Revision history for this message
|
#17 |
Thanks Manfred Hampl, that solved my question.