Results 1 to 5 of 5

Thread: How can I add new user to already existing group in console mode ?[Solved]

  1. #1
    Join Date
    Apr 2013
    Beans
    2

    How can I add new user to already existing group in console mode ?[Solved]

    Hi!
    Like in the title, I want to add a user to already existing group.
    In fact it´s seems that i already did this because i used a command "adduser --ingroup groupA user2” and when I look to the passwd i see that "user2(this is the user that i want to add)" is assignated to the groupA.
    But the problem appear when i want to log in to the user2, because when I type the password, Linux don´t do nothing. I think that is some problem with permition, and i tried to change the owner of the document groupA(with chown) but it doesn´t gave me any any results, so here is my question:
    Do i do something wrong or i need to use other command?

    I hope i explained this well and i hope you can help me guys.

    P.S.
    Sorry for my english.
    Last edited by Azano; 4 Weeks Ago at 09:37 AM.

  2. #2
    Join Date
    Apr 2011
    Location
    Human Monument Project
    Beans
    1,213
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How can I add new user to already existing group in console mode ?

    I just run
    Code:
    sudo adduser username groupname
    Look here for more
    Code:
    man adduser
    Splat
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful.

  3. #3
    Join Date
    Sep 2006
    Beans
    5,504
    Distro
    Lubuntu Development Release

    Re: How can I add new user to already existing group in console mode ?

    chown and many other system utilities won't say anything when they run correctly. It is expected that they just work and not say anything unless there was an error. Can you verify that you changed the group of the document using ls -hl?

    If both the user and the group already exist, you can add the user to the group with gpasswd

    Code:
    sudo gpasswd --user user2 groupa
    The membership in the new group won't take effect until that user logs out and then logs back in again.

  4. #4
    Join Date
    Apr 2013
    Beans
    66
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How can I add new user to already existing group in console mode ?

    Assuming that the group and username are already created, I do it with:

    Code:
    sudo usermod -aG <groupname> <username>
    then I check with

    Code:
    cat /etc/group | grep <groupname>
    I usually find the <username> as a part of the <groupname> in the /etc/group

  5. #5
    Join Date
    Apr 2013
    Beans
    2

    Re: How can I add new user to already existing group in console mode ?

    Problem solved, i used the option from @deadflowr. Thanks guys.

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
  •