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

Re: Changing groups



Dan Jones <ddjones@riddlemaster.org> writes:

> Uh, no.  That's the way I thought it worked.  That's the way BSD works. 
> That's not the way Linux works.  I found this out the hard way when I
> created groups and could not access files owned by them, even though I
> was clearly in the group.  From "Linux Unleashed" by Tim Parker:

"Linux Unleashed"?  Clearly it's wrong, as could be guessed by the
publisher.

> Try it yourself.  Create a new group and add yourself to it.  Then
> create a file, change it's owner to whoever and its group to the new
> group.  Set permissions to 770 and try to read the file.

Did it.  Created a directory.  Changed it to 770, owned root:test.
Added myself to test.  Tried to cd to it.  Failed, naturally.  ssh'd
in to localhost, was able to cd into it fine and look at what id says:

uid=1000(ats) gid=1000(ats)
groups=1000(ats),4(adm),20(dialout),25(floppy),29(audio),100(users),102(lpadmin),103(shared),1004(test)

Yes, you absolutely have to log back in to get the new perms, but you
don't need to run newgrp.  I haven't used newgrp in about 6 years or
so, and the last time only because I didn't want to log out to get
the new group.

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
Gates's girlfriend discovers why he's called "Mr MicroSoft"



Reply to: