Re: The newgrp command

From: Vidol Loeung (fedora.kh_at_undp.org)
Date: 08/25/05

  • Next message: Vidol Loeung: "Re: The newgrp command"
    Date: Thu, 25 Aug 2005 10:13:55 +0700
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    Thanks. It's kind of short. However, it seems clear from this link
    (http://www.tldp.org/LDP/intro-linux/html/sect_03_04.html) that a user can
    use newgrp command successfully only if the new group (s)he would like to
    switch to is already a secondary group for the user.

    Regards,
    Vidol

    ----- Original Message -----
    From: "Richard E Miles" <r.godzilla@comcast.net>
    To: "For users of Fedora Core releases" <fedora-list@redhat.com>
    Sent: Thursday, August 25, 2005 8:25 AM
    Subject: Re: The newgrp command

    > On Thu, 25 Aug 2005 08:24:05 +0700
    > Vidol Loeung <fedora.kh@undp.org> wrote:
    >
    > > Thanks Richard. When I as a user used newgrp to switch myself to a new
    > > group, I of course gave the password of that group, which was assigned
    by
    > > the gpasswd comamnd as you mentioned. I also agree that, this command is
    > > rarely used and I think, it only makes sense when a user would like
    > > files/directories (s)he creates to belong to a particular group. Having
    the
    > > user as a member in each group is fine.
    > >
    > > My question was out of curiosity as I was trying to experiment the
    newgrp
    > > command and found that it did not seem to work the way it should as its
    > > manual and documentations stated that the command is used to switch a
    user
    > > to a new group and requires the group password.
    > >
    > > Let me give a scenario here:
    > > - I logged in as user 'joe'.
    > > - Then, I typed this command ('joe' is not a member of group 'users'):
    > > $ newgrp users
    > > Password:
    > > newgrp: Permission denied
    > >
    > > I've wondering what the group passwd command is used for and found that
    the
    > > newgrp command is the one that needs the group passwd. Now, when I tried
    it
    > > as above it did not work.
    > >
    > > Would someone kindly clarify a bit more on the use of the newgrp
    command?
    > >
    > > Regards,
    > > Vidol
    > >
    > > ----- Original Message -----
    > > From: <rengland@europa.com>
    > > To: "For users of Fedora Core releases" <fedora-list@redhat.com>
    > > Sent: Wednesday, August 24, 2005 3:07 AM
    > > Subject: Re: The newgrp command
    > >
    > >
    > > > > Thank you Ben and Richard for yoru replies.
    > > > >
    > > > > Well, Ben you are right, root can switch to any group without having
    to
    > > > > give
    > > > > a password. I also discovered the same as what Richard said.
    However, in
    > > > > case an ordinary user is not a member of a particular group and
    she/he
    > > > > tries
    > > > > to use the newgrp command to switch to that group with correct
    password,
    > > > > it
    > > > > always gave the error message: Permission denied.
    > > > >
    > > > > Read a lot of docs on it but still could not help.
    > > > >
    > > > > Regards,
    > > > > Vidol
    > > > >
    > > > >
    > > > > ----- Original Message -----
    > > > > From: "Richard England" <rengland@europa.com>
    > > > > To: "For users of Fedora Core releases" <fedora-list@redhat.com>
    > > > > Sent: Tuesday, August 23, 2005 1:06 PM
    > > > > Subject: Re: The newgrp command
    > > > >
    > > > >
    > > > >>
    > > > >> Ben Stringer wrote:
    > > > >>
    > > > >> >On Tue, 2005-08-23 at 12:17 +0700, Vidol Loeung wrote:
    > > > >> >
    > > > >> >
    > > > >> >>Dear All:
    > > > >> >>
    > > > >> >>The newgrp command seems simple to use. However, I could not use
    it
    > > or
    > > > >> I
    > > > > did
    > > > >> >>not know how to use it.
    > > > >> >>
    > > > >> >>Could someone please explain me what teh problem is? I was logged
    in
    > > > >> as
    > > > > an
    > > > >> >>ordinary user and type the command:
    > > > >> >>$ newgrp users
    > > > >> >>It asked me for the group password and I entered it but it said:
    > > > > "Permission
    > > > >> >>denied".
    > > > >> >>
    > > > >> >>
    > > > >> >
    > > > >> >Hi Vidol,
    > > > >> >
    > > > >> >You will need to be the root user to run this command.
    > > > >> >
    > > > >> >Try this:
    > > > >> >
    > > > >> >$ su -
    > > > >> ># newgrp users
    > > > >> >
    > > > >> >Cheers, Ben
    > > > >> >
    > > > >> >
    > > > >> >
    > > > >> >>Regards,
    > > > >> >>Vidol
    > > > >> >>
    > > > >> >>
    > > > >> >>
    > > > >> I don't believe that is strictly true. If the userid is included
    in
    > > > >> several groups, all the user has to do is type in "newgrp
    > > <newgrpname>".
    > > > >> However, if the user is NOT member of the group, then they are
    prompted
    > > > >> for the group password.
    > > > >>
    > > > >> Use the command "id" to find out what your primary group currently
    is,
    > > > >> and the command "groups" to find out what groups your userid is
    > > > >> currently a member of.
    > > > >>
    > > > >> --R
    > > > >>
    > > > >> --
    > > > >> fedora-list mailing list
    > > > >> fedora-list@redhat.com
    > > > >> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    > > > >
    > > > > --
    > > > > fedora-list mailing list
    > > > > fedora-list@redhat.com
    > > > > To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    > > > >
    > > > >
    > > >
    > > >
    > > > I'm no expert on this but what password were you entering for the
    group?
    > > > Do you know what, if any password was assigned to the group? It may
    or
    > > > may not be the same as you login passwd.
    > > >
    > > > You can modify the group password using gpasswd (see the man page).
    I
    > > > did not investigate to find out how the original (creation time)
    password
    > > > is set.
    > > >
    > > > I've only used a small number of groups (3-4) on my personal machine
    and
    > > > I've added my userid to each so I've never had to use newgrp there.
    At
    > > > work I don't have permissions to modify anything at this level so I've
    not
    > > > worked with it.
    > > >
    >
    > see man newgrp.
    >
    >
    > --
    > Richard Miles
    > Federal Way WA. USA
    > registered linux user 46097
    >
    > --
    > fedora-list mailing list
    > fedora-list@redhat.com
    > To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Vidol Loeung: "Re: The newgrp command"

    Relevant Pages

    • Re: newgrp help
      ... "When you run the command, the system places you in a new shell..." ... So it may run .profile and the like again. ... > Subject: newgrp help ... > I am trying to understand the newgrp command. ...
      (AIX-L)
    • Re: [opensuse] Installation methods
      ... >> Regards, Rajko. ... I downloaded a script yesterday. ... So I should have ran "chmod 777 ... I also ran the chmod command for yet another program I was attempting to ...
      (SuSE)
    • Re: Creating Recovery CD problem
      ... > second one (use format command). ... Then you copy SDI file to the second partition and expand it to the first one with command like ... >> I did a little test on KM's advice ... >> thanks regards and Merry Christmas. ...
      (microsoft.public.windowsxp.embedded)
    • Re: ntfs.sys missing or corrupt
      ... indicated in this command. ... If the ntfs.sys file is there and corrupt it will rename it. ... not there then it was missing. ...
      (microsoft.public.windowsxp.general)
    • Re: FC1 -> FC2: very slow xDSL connection...
      ... Best regards. ... >>with the local and remote IP addresses and DNS' addresses. ... some traceroute and ping command show that DNS is ... Must I recompile the kernel, or have I just to echo something ...
      (Fedora)