Re: /dev/ttyS0 permission error



Jay Cliburn wrote:
I've seen references to this scattered about on the web, but no solutions.

I installed FC6 on a Dell Inspiron 4000 laptop to use as a serial
console for debugging kernel problems. Whenever I start minicom on the
laptop, however, I'm greeted with a permission denied error to
/dev/ttyS0. Sure enough, the perms on ttyS0 are 0660 and I'm not a
member of the uucp group:

crw-rw---- 1 root uucp 4, 64 Dec 1 06:04 /dev/ttyS0
crw-rw---- 1 root uucp 4, 65 Dec 1 06:03 /dev/ttyS1
crw-rw---- 1 root uucp 4, 66 Dec 1 06:03 /dev/ttyS2
crw-rw---- 1 root uucp 4, 67 Dec 1 06:03 /dev/ttyS3

No problem, I thought -- I'll just gin up a udev rule and set the perms
to 0666. Sorry; doesn't work. As a matter of fact, it gets worse:
perms on ttyS0 go to 0600 root:root as a result of my new local rule.

Okay, not an ideal solution, but let's modify 50-udev.rules and set the
default rule for tty[A-Z]* to MODE="0666". Nope. Now they're *all*
0600 root:root.

Here's the rule:
KERNEL=="ttyS0", NAME="%k", GROUP="uucp", MODE="0666"

I had no problems with this under Debian Etch and Knoppix Live running
on the same laptop. Debian was running a 2.6.17 kernel, and for the
life of me I can't remember the Knoppix kernel version (the web site
says 2.6.x -- big help), and I don't have the CD here at home.

The current workaround is to add non-root users to the uucp group. (Or
maybe this is the solution?) Any ideas why I can't get a udev rule to
change the perms to 0666 on /dev/ttyS0?

Thanks,
Jay


The kernel version will not make a difference. The difference is
probably in the settings of console permissions. (man console.perms)
The permissions of some devices are changed when the first non-root
user does a local login to the machine. They are changed again when
they log out. That way, a user that is at the machine itself gets to
use things like the floppy drive, sound card, and what ever else you
configure. I was surprised to discover that FC5 didn't handle the
serial ports. As I don't have FC6 installed yet, I am not sure if it
does. (My laptop does not have serial ports, so it is not that
important to me.)

Now, if you want the user that is logged into the console to be able
to use the serial ports, you could probably do something like create
a file /etc/security/console.perms.d/10-serial.perms with something
like:

# Serial port rules.
<serial>=/dev/ttyS*

<console> 0660 <serial> 0660 root.uucp

If you just want to control /dev/ttyS0 then change ttyS* to ttyS0.

Mikkel
--

Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: Linux Kernel Hang or stop after uncompressing MPC8245
    ... So i just compile a new Kernel with options we have talking about... ... And it's freeze, nothing to the console... ... x x Maximum number of non-legacy 8250/16550 serial ports x x ... Try autodetect IRQ? ...
    (Linux-Kernel)
  • Hardware Console Redirection
    ... I have noticed that the "Phoenix BIOS" console redirection feature on both discontinues to operate once the kernel has booted. ... Is there some routine in the *BSD kernel console code that performs an operation, perhaps a reset, on the serial ports, that wouldn't happen in DOS? ...
    (freebsd-questions)
  • miibus, ed0, and the realpath security advisory
    ... dmesg and kernel config below. ... miibus0: <MII bus> on dc0 ... sc0: <System console> on isa0 ... # The `bpf' pseudo-device enables the Berkeley Packet Filter. ...
    (freebsd-questions)
  • [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
    ... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS transport protocol load balancing support ...
    (Linux-Kernel)
  • [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
    ... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS transport protocol load balancing support ...
    (Linux-Kernel)