Quote:
Originally Posted by jmgibson1981
$ touch indeed
touch: cannot touch 'indeed': Permission denied
|
Ar this moment you're in group "jason", which doesn't have write access to the . directory.
Quote:
$ newgrp windowsbackup
$ touch indeed
|
But now you have changed your group to windowsbackup, so now the touch works.
That you're allowed to use the "newgrp" command without a password is because you are in both groups already. But now the default group for your session is that one, not jason anymore:
Quote:
newgrp changes the current real group ID to the named group, or to the default group listed in /etc/passwd if no group name is given. newgrp also tries to add the group to the user groupset.
|
But a file (or directory) can be given only a single group ID and that is the "real group ID" of the session, which starts as the one, listed in /etc/passwd
To revert to that default afterwards, you can just issue the command "newgrp" without any parameters.