Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

groups



On Mon, May 11, 2009 at 11:44 AM, Laura Conrad <sunny-O0WJhd4tT3hg9hUCZPvPmw at public.gmane.org> wrote:
>
> I've always had the hardest time using groups the way they're intended.
>
> Right now, I have a directory I want to edit as a user, which was
> installed by the package manager as readable and writeable only by root.
>
> So what I did was set up a new group, and add my user to that group, and
> change the ownership of that directory to that group, and change the
> permissions to allow reading and writing by the group.
>
> As root, when I look at permissions and ownership, they look the way I
> expect. ?As the user, if I say "groups username", it lists the new
> group, but if I just say "groups", it doesn't, even if I open a new tab
> after having added username to the group.
>
> And it doesn't let me write to the directory.
>
> So what do I do to tell the system that it should see username and a
> member of the new group?

You have to log off and back on.  When you use just "groups", it's
telling you the groups that your current shell process is in.
With a "groups username", it's looking things up in the appropriate
files and telling you what groups that user will be in at the NEXT
login.  Groups for your current login are set during the login process
and essentially never change.

There is a command "newgrp" which you can use to start a shell in a
particular group (if you know the password for the group not your user
password).   But this is different from what the the login process
does and in any case only affects children of that shell not other
shells or commands started from your window manager.  So if you want
to really see the long term effects of the changes, you should log off
and back on (or maybe "ssh localhost" to see just the effects at a
shell prompt).

Bill Bogstad







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org