2

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!

7

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.

1
  • That worked perfectly - don't have to restart my screen session, thanks! Mar 12 '11 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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