[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Permissions not working as expected

Posted on 2001-06-29
2
Medium Priority
?
191 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 200 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month19 days, 17 hours left to enroll

873 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