Closed Thread
Results 1 to 8 of 8

Thread: Add user to group

  1. #1
    mop
    mop is offline Learning Programmer
    Join Date
    Apr 2008
    Posts
    30
    Rep Power
    0

    Add user to group

    Anyone know how to add a user to a group via SSH in Linux?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest
    If the user already exists you can use 'usermod':

    Code:
    # usermod -a -G <NewGroup> <UserName>
    This will add a group to a user as a secondary group. If you want to change the primary group:

    Code:
    # usermod -g <Group> <UserName>

  4. #3
    Hektor is offline Programmer
    Join Date
    Jan 2007
    Posts
    126
    Rep Power
    0
    Isn't there a way to do this when you create the user also?

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Well, when doing that through a GUI you can, so I guess you can from the CLI too...

  6. #5
    SexYLinuX Guest
    But I think GUI is different....

  7. #6
    Tor
    Tor is offline Programming Expert
    Join Date
    Oct 2007
    Posts
    488
    Rep Power
    0
    You can add them to groups at creation with the useradd command:

    Code:
    # useradd -G {group-name} username

  8. #7
    SexYLinuX Guest
    Hehe, the command is nearly the same as the moduser... but instead it's adduser.. funny.

  9. #8
    HappyUser is offline Learning Programmer
    Join Date
    Jan 2008
    Posts
    40
    Rep Power
    0
    Yeah the GUI is different, but at the back there is the CLI I think... it still executes the same commands... but in a nicer way!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Join the .NET group!
    By cdg10620 in forum ASP, ASP.NET and Coldfusion
    Replies: 5
    Last Post: 04-06-2010, 09:41 AM
  2. User Group?
    By Wanch in forum Linux Installation & Configuration
    Replies: 7
    Last Post: 10-02-2008, 04:11 AM
  3. Greetings from F&H Solutions Group
    By FHSolutionsGroup in forum Introductions
    Replies: 1
    Last Post: 10-19-2007, 01:06 PM
  4. Add user to group in Linux
    By erik in forum Linux Applications
    Replies: 1
    Last Post: 10-18-2007, 07:38 AM

Tags for this Thread

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