Solved

Permissions not working as expected

Posted on 2001-06-29
2
180 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now