Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Permissions not working as expected

Posted on 2001-06-29
2
Medium Priority
?
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

636 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