Results 1 to 4 of 4

Thread: Show a Users Groups ?

  1. #1
    Join Date
    May 2008
    Beans
    32

    Show a Users Groups ?

    Hello All,

    I'm wondering how to show the groups a particular user belongs to, also how do I go about adding a existing user to a group ?lets say the wheel group.

    I think its something like usermod user1 -G wheel

  2. #2
    Join Date
    Apr 2009
    Beans
    Hidden!
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Show a Users Groups ?

    To show groups:
    Code:
    groups USERNAME
    To add a user to an existing group:
    Code:
    sudo adduser USERNAME GROUP
    To make a new group:
    Code:
    sudo addgroup GROUP
    Last edited by michy99; August 17th, 2009 at 07:33 PM. Reason: Forgot 'sudo'

  3. #3
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Show a Users Groups ?

    Quote Originally Posted by UltraDangerLord View Post
    I think its something like usermod user1 -G wheel
    michy99's is the easiest way to remember, but just fyi, the version you were thinking of is:
    Code:
    sudo usermod -aG groupname user
    the a is important as if you just do -G then any existing group memberships are removed, leaving ONLY the one you specify.

  4. #4
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,292
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Show a Users Groups ?

    Quote Originally Posted by UltraDangerLord View Post
    I'm wondering how to show the groups a particular user belongs to
    Code:
    id <user>
    「明後日の夕方には帰ってるからね。」


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •