Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th February 2007, 10:57 AM
FunkyRes Offline
Registered User
 
Join Date: Nov 2004
Posts: 189
/dev/ttyS0 console user

Howdy -

I need the serial port to be available to the console user.
IE console user (first to log in) has permission to read/write to it.

I've set that up before ages ago - in RH 8 - but I don't remember what I did and I think HAL has changed how it is done.

Any pointers appreciated.
Reply With Quote
  #2  
Old 14th February 2007, 11:44 AM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
You can use agetty in inittab, add something like

S0:2345:respawn:/sbin/agetty -w 9600 ttyS0

Here's an example for connecting a vt100
http://www.linux.com/howtos/Remote-S...y-agetty.shtml
Reply With Quote
  #3  
Old 14th February 2007, 12:11 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Unless you just mean you want the port set up for access (no terminal connected), then you can issue a 'setserial /dev/ttyS0 <parameters>' command in rc.local, and change the permissions on /dev/ttyS0 so your user can access it (probably best to create a group and add the user to the group rather than allowing open access EDIT, or just add the user to the uucp group - I just noticed that this group has rw access on /dev/ttyS* by default)

Last edited by sideways; 14th February 2007 at 12:50 PM.
Reply With Quote
  #4  
Old 14th February 2007, 01:00 PM
FunkyRes Offline
Registered User
 
Join Date: Nov 2004
Posts: 189
There was in RH the concept of a console user - which was set to the first user to log into a physical console. Log in via ssh and even if no one else is logged in, it does not get reset.

I get the distinct impression Fedora still does that:

Code:
[mpeters@atlantis ~]$ ls -l /dev/ |grep mpeters
crw------- 1 mpeters root    14,   12 Feb 14 02:38 adsp
crw------- 1 mpeters root    14,    4 Feb 14 02:38 audio
crw------- 1 mpeters root     5,    1 Feb 14 02:38 console
crw------- 1 mpeters root    14,    3 Feb 14 02:38 dsp
brw-rw---- 1 mpeters floppy   2,    0 Feb 14 02:38 fd0
brw-rw---- 1 mpeters floppy   2,   84 Feb 14 02:38 fd0u1040
*snip*
srwx------ 1 mpeters root           0 Feb 14 02:38 gpmctl
crw------- 1 mpeters root    14,    2 Feb 14 02:38 midi
crw------- 1 mpeters root    14,    0 Feb 14 02:38 mixer
crw------- 1 mpeters root    14,    1 Feb 14 02:38 sequencer
crw------- 1 mpeters root    14,    8 Feb 14 02:38 sequencer2
That's the right way to do it and is better than setting a group - as it insures only the console user has elevated privileges with the device.

I'll look in the /etc/udev directory and see if I can figure out how to do it.
Reply With Quote
  #5  
Old 14th February 2007, 01:17 PM
FunkyRes Offline
Registered User
 
Join Date: Nov 2004
Posts: 189
I think I figured it out - rebooting to test
Reply With Quote
  #6  
Old 14th February 2007, 01:26 PM
FunkyRes Offline
Registered User
 
Join Date: Nov 2004
Posts: 189
Yes - I got it figured out.

I created the file

/etc/security/console.perms.d/51-custom.perms

containing the following:
Code:
# device classes -- these are shell-style globs
<garmin>=/dev/ttyS0

# permission definitions
<console> 0600 <garmin> 0660 root.uucp
After a reboot:

Code:
[mpeters@atlantis ~]$ ls -l /dev/ttyS*
crw------- 1 mpeters uucp 4, 64 Feb 14 05:19 /dev/ttyS0
crw-rw---- 1 root    uucp 4, 65 Feb 14 05:19 /dev/ttyS1
crw-rw---- 1 root    uucp 4, 66 Feb 14 05:19 /dev/ttyS2
crw-rw---- 1 root    uucp 4, 67 Feb 14 05:19 /dev/ttyS3
So I'm golden
Reply With Quote
  #7  
Old 14th February 2007, 01:29 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
what's the difference between that and doing

Code:
chown mpeters:uucp /dev/ttyS0
in fact why not just add mpeters to the uucp group as suggested?
Reply With Quote
  #8  
Old 14th February 2007, 03:57 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Ok, I think I get it now. You want whoever logs in to the local console to have access to ttyS0, so after you log out if someone else logs in (non-root) they also can access the port

http://www.redhat.com/docs/manuals/l...m-console.html

Glad you were able to sort it and help me understand a bit more.
Reply With Quote
Reply

Tags
console, or dev or ttys0, user

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a user form the console with a password? the poi Using Fedora 9 31st May 2006 08:42 PM
ttyS0 changing user websmith Using Fedora 3 16th March 2006 05:37 PM
I have 2 ttyS0? yj0930 Hardware & Laptops 0 23rd December 2005 11:28 AM


Current GMT-time: 10:04 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat