LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2009, 12:36 PM   #1
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Rep: Reputation: 16
how to assign oneself to a group to get access to a file


I'm on a regular Fedora 9 desktop computer with an ext3fs filesystem.

I'm trying to give myself access to /dev/ttyS0. This is because I'm developing code that uses a serial port. While I'm developing this code I don't want to be continually working as super user. I have the following information about /dev/ttyS0:

Code:
[freddy@localhost ~]$ ls -lh /dev/ttyS0 
crw-rw---- 1 root uucp 4, 64 2009-09-04 12:27 /dev/ttyS0
So as root I added myself (username freddy) to the group uucp. This is just temporary, for while I work on this code and try different stuff as user freddy. Once the code is established and I have a single program with a fixed name, I plan to give myself an entry in /etc/sudoers that will allow me to run the finished program. Here's the info on user freddy:

Code:
[freddy@localhost ~]$ id freddy
uid=500(freddy) gid=500(freddy) groups=500(freddy),14(uucp) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[freddy@localhost ~]$ groups freddy
freddy uucp
The problem then is that now if I try to use /dev/ttyS0 I can't.

Code:
[freddy@localhost ~]$ echo "hello" > /dev/ttyS0
bash: /dev/ttyS0: Permission denied
[freddy@localhost ~]$ cat /dev/ttyS0
cat: /dev/ttyS0: Permission denied
I thought that if I was a member of group uucp which is associated with /dev/ttyS0 that I would be given rw access to /dev/ttyS0. What am I missing here?

Also, does anyone know what the c stands for in the ls -l listing?

Last edited by chadwick; 09-04-2009 at 12:39 PM.
 
Old 09-04-2009, 12:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
c = character device, as opposed to b for block device.

are you running selinux here? I can see the contexts listed for your ID, is that possibly getting in the way? In general though you are in that group, and should be fine, but also note those changes are picked up on a login session starting, so old terminals won't get them.
 
Old 09-04-2009, 01:38 PM   #3
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by acid_kewpie View Post
those changes are picked up on a login session starting, so old terminals won't get them.
Thanks. This was the problem. No, I'm not using selinux.

Last edited by chadwick; 09-04-2009 at 01:40 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we assign group password?? JATA01 Linux - Server 5 11-15-2008 12:47 AM
how to assign priority to different Access Points? shariqkhan1 Linux - Wireless Networking 5 11-15-2006 04:58 PM
How to give access rights to one group to the home-dirs of another group Peter@KKVS Linux - Networking 2 11-09-2006 12:38 AM
How to assign directory access to a user linuxfans Linux - General 7 04-16-2003 12:06 PM
Assign group by IP waifurchin Linux - General 1 01-29-2003 04:36 PM


All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration