Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've noticed that when I add myself to a new group with usermod newgroup -g wayne I will have the group listed when I say groups, but if I were to do something such as

sudo mkidr /usr/local/grouptest
sudo chown root:newgroup /usr/local/grouptest
cd /usr/local/grouptest
touch test.txt
touch: cannot touch `test.txt': Permission denied

I get permission denied. When I'm connected across a ssh session, I have to re-connect and then the permissions are in effect for that directory. Is there a way to get around that? Especially since using GNU screen, I would have to kill and re-create all my windows which would be incredibly pesky.

Any help would be greatly appreciated!

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

usermod -g edits /etc/group, but initgroups() is only called by /bin/login. That said, newgrp should work to switch to the new group, at the price of starting an extra shell.

share|improve this answer
    
That worked perfectly - don't have to restart my screen session, thanks! –  Wayne Werner Mar 12 '11 at 9:10
    
Good to know. Thanks, eh! –  user973810 Jun 2 at 19:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.