On Thursday 14 Aug 2003 1:28 am, Dan Jones wrote: > On Wed, 2003-08-13 at 19:30, Stephen Kuhn wrote: > > On Thu, 2003-08-14 at 09:12, Dan Jones wrote: > > > How does one go about using newgrp in an xwindows environment? > > > Executing the command in a shell only effects that shell. > > > > "newgrp" is for creating a new user group - this is probably best > > done through Webmin, MCC or KUSER... > > Uh, no. > > Under Linux, you're only a member of one group at a time. newgrp > allows you to change your current group. > > For example, I have a web server. I don't want my web pages to be > world writable. However, I do want multiple people (say, a > development team) to be able to modify the files. So I create a > group called www and add the users to that group. I then assign > ownership of the html files to that group (and set group permissions > for those files to rwx.) > > However, when I log in I'm not a member of the www group (unless I > change my primary group to www.) If I attempt to edit the html file, > I'll get permission denied when I try to save it. However, if I open > a terminal, execute the command "newgrp www", my group is changed to > www. I can then edit the file in vi and save it. However, I can't > edit the file in, say, amaya, because the newgrp command only affects > the shell it's executed in (ie, the terminal.) My xwindows session > still sees me in my default group. > > Now, I could change my default group to www, but what if I'm a member > of several different development groups? I don't want to have > different log-ins for each group, and have to log out and log back in > as a different user when I want to work on a different project. > However, unless there's a way to execute newgrp and have it affect > the parent process, I don't see a way around this. > > Am I missing something fundamental in my understanding of groups and > permissions?
Only that your group is inherited by processes that you start. If you do newgrp www and then start a file manager or editor from that commandline they will be in group www. It would be useful to have the KDE panels able to switch groups, but I don't think they can. -- Richard Urwin
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
