Accessing serial-usb ports

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Aug 14 14:12:33 UTC 2006


On Fri, Aug 11, 2006 at 11:31:13PM -0400, phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org wrote:
> 
> USB ports are complex to access in software so people have developed
> hardware and software to access USB ports as serial ports. These serial
> port devices have names like /dev/ttyUSB0 and conveniently the drivers are
> built into the kernel since 2.4. We used this extensively in our Tcl
> software that drives our scope and signal generator. The software simply
> treats these ports as serial ports, which Tcl can access. (At the other
> end of the cable there is a hardware integrated circuit that reconverts
> the USB protocol into asynchronous serial data. So the whole USB protocol
> can be ignored.)
> 
> A Linux serial-usb port is created when you plug in a USB device, and
> disappears when you unplug the device. Unfortunately, the port is created
> as owned by root and the read and wite permissions are disabled for
> ordinary users. Consequently, if you operate in user mode you have to
> become root and change these permissions every time a device is plugged
> and unplugged, or when you reboot.
> 
> This gets old fast, so we need a better solution than manual intervention.
> In my Suse Linux, a long-listing shows that the 'uucp' group has access to
> the device. I'm therefore proposing that users of this software simply add
> themselves as members of the uucp group. This seems to work fine, but I
> wonder if there are other unpleasant side-effects that might result.
> 
> I would welcome some comments on this approach - does it create security
> holes, for example? And pointers to alternative approaches would be
> welcome.

The simple solution is to add a rule to udev's scripts that says what
permissions and ownership the usb serial port should have when it is
created.  This is part of udev's job after all.

--
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list