Solved

Permissions not working as expected

Posted on 2001-06-29
2
183 Views
Last Modified: 2013-12-15
I want a user to be able to write into the /var/lock directory under Linux Red Hat 7.1.

foo> ls -l /var | grep lock
drwxrwxr-x    5 root     uucp         4096 Jun 29 04:02 lock

Since the group for this directory is 'uucp' I added the user freddie to the 'uucp' group.

foo> grep uucp /etc/group
uucp:x:14:uucp,freddie

But I still can NOT write to that directory. (See below)

foo> touch /var/lock/foobar
touch: creating `/var/lock/foobar': Permission denied

Any ideas? I have the same problem with writing to the serial port /dev/ttyS0
0
Comment
Question by:tgoetze
2 Comments
 
LVL 3

Accepted Solution

by:
jnbkze earned 50 total points
ID: 6240529
OK, at the prompt, try this:

$ id
(this should output his UID, then his GID, and then the groups that he is a member of)
You will probably see his GID still as freddy.

Now type:
$ newgrp uucp
$ id

Now you should see that his GID has changed to uucp and no longer freddy. Now he should be able to write to the var lock dir.

Take note that when you do newgrp you are in effect launching a new shell, so when you exit, you will have to exit out of the new group shell, and then out of the login shell. This also effect ENV vars etc.

Let me know if this doesn't help you.
0
 
LVL 3

Author Comment

by:tgoetze
ID: 6241893
Thanks. I didn't realize that adding someone to a new group would essentially NOT take affect until after a subsequent login. I guess caching the user's groups at login is a reasonable thing to do (rather than having to re-check everytime a user attempts to access a file).

While "id" and "newgrp" are interesting, what I really needed to do was login again (which I have a habit of not doing--thanks to vnc).

Thanks again!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question