Why didn't my user get assigned to the group I had added myself to?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I'm on a fresh installation of Ubuntu 18.04. During installation, I chose the minimal installation instead of the standard one.



I just added myself to the docker group using the following command



sudo usermod -a -G docker danny


I have logged out from my GNOME session (I tried both, from the top bar's menu, and from searching for "logout"). But my user did not get assigned to the docker group. However, if I su into my user, the group is there so the previous command did not fail.



$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare
$ groups danny
danny adm cdrom sudo dip plugdev lpadmin sambashare docker
$ su - danny
$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare docker


I had to do a full OS reboot for the change to take effect.



I have already rebooted, but this the ouput of id;



$ id
uid=1000(danny) gid=1000(danny) groups=1000(danny),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),999(docker)


But I'm wondering why logging out isn't enough?



P.S. I am able to reproduce this behavior by adding myself to any random group, not just docker.







share|improve this question






















  • I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
    – Dan
    May 10 at 12:03














up vote
0
down vote

favorite












I'm on a fresh installation of Ubuntu 18.04. During installation, I chose the minimal installation instead of the standard one.



I just added myself to the docker group using the following command



sudo usermod -a -G docker danny


I have logged out from my GNOME session (I tried both, from the top bar's menu, and from searching for "logout"). But my user did not get assigned to the docker group. However, if I su into my user, the group is there so the previous command did not fail.



$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare
$ groups danny
danny adm cdrom sudo dip plugdev lpadmin sambashare docker
$ su - danny
$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare docker


I had to do a full OS reboot for the change to take effect.



I have already rebooted, but this the ouput of id;



$ id
uid=1000(danny) gid=1000(danny) groups=1000(danny),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),999(docker)


But I'm wondering why logging out isn't enough?



P.S. I am able to reproduce this behavior by adding myself to any random group, not just docker.







share|improve this question






















  • I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
    – Dan
    May 10 at 12:03












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm on a fresh installation of Ubuntu 18.04. During installation, I chose the minimal installation instead of the standard one.



I just added myself to the docker group using the following command



sudo usermod -a -G docker danny


I have logged out from my GNOME session (I tried both, from the top bar's menu, and from searching for "logout"). But my user did not get assigned to the docker group. However, if I su into my user, the group is there so the previous command did not fail.



$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare
$ groups danny
danny adm cdrom sudo dip plugdev lpadmin sambashare docker
$ su - danny
$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare docker


I had to do a full OS reboot for the change to take effect.



I have already rebooted, but this the ouput of id;



$ id
uid=1000(danny) gid=1000(danny) groups=1000(danny),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),999(docker)


But I'm wondering why logging out isn't enough?



P.S. I am able to reproduce this behavior by adding myself to any random group, not just docker.







share|improve this question














I'm on a fresh installation of Ubuntu 18.04. During installation, I chose the minimal installation instead of the standard one.



I just added myself to the docker group using the following command



sudo usermod -a -G docker danny


I have logged out from my GNOME session (I tried both, from the top bar's menu, and from searching for "logout"). But my user did not get assigned to the docker group. However, if I su into my user, the group is there so the previous command did not fail.



$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare
$ groups danny
danny adm cdrom sudo dip plugdev lpadmin sambashare docker
$ su - danny
$ groups
danny adm cdrom sudo dip plugdev lpadmin sambashare docker


I had to do a full OS reboot for the change to take effect.



I have already rebooted, but this the ouput of id;



$ id
uid=1000(danny) gid=1000(danny) groups=1000(danny),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),999(docker)


But I'm wondering why logging out isn't enough?



P.S. I am able to reproduce this behavior by adding myself to any random group, not just docker.









share|improve this question













share|improve this question




share|improve this question








edited May 10 at 12:04

























asked May 10 at 11:54









Dan

6,66334273




6,66334273











  • I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
    – Dan
    May 10 at 12:03
















  • I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
    – Dan
    May 10 at 12:03















I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
– Dan
May 10 at 12:03




I even tried su - $USER too, same result. There are no other users on this installation (besides the system ones). Also, I am able to reproduce it with any group, not just docker.
– Dan
May 10 at 12:03










2 Answers
2






active

oldest

votes

















up vote
0
down vote













You don't need to reboot to assign the additional group to your user. In the running shell the group assignment doesn't change, but it does in a new shell:



jean@myLinux:~$ sudo groupadd tester
[sudo] password for jean:
jean@myLinux:~$ sudo usermod -a -G tester jean
jean@myLinux:~$ id
uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
jean@myLinux:~$ su - jean
Password:
jean@myLinux:~$ id
uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1003(tester)





share|improve this answer






















  • That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
    – Dan
    May 10 at 15:00

















up vote
0
down vote













You can also use the newgrp command to join a new group:



jean@myLinux:~$ id
uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
jean@myLinux:~$ newgrp - newgroup
jean@myLinux:~$ id
uid=1000(jean) gid=1003(newgroup) groups=1003(newgroup),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1000(jean)


I must confess that I'm as surprised as you that logout / login doesn't assign the new group, but su - does.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034463%2fwhy-didnt-my-user-get-assigned-to-the-group-i-had-added-myself-to%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You don't need to reboot to assign the additional group to your user. In the running shell the group assignment doesn't change, but it does in a new shell:



    jean@myLinux:~$ sudo groupadd tester
    [sudo] password for jean:
    jean@myLinux:~$ sudo usermod -a -G tester jean
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
    jean@myLinux:~$ su - jean
    Password:
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1003(tester)





    share|improve this answer






















    • That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
      – Dan
      May 10 at 15:00














    up vote
    0
    down vote













    You don't need to reboot to assign the additional group to your user. In the running shell the group assignment doesn't change, but it does in a new shell:



    jean@myLinux:~$ sudo groupadd tester
    [sudo] password for jean:
    jean@myLinux:~$ sudo usermod -a -G tester jean
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
    jean@myLinux:~$ su - jean
    Password:
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1003(tester)





    share|improve this answer






















    • That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
      – Dan
      May 10 at 15:00












    up vote
    0
    down vote










    up vote
    0
    down vote









    You don't need to reboot to assign the additional group to your user. In the running shell the group assignment doesn't change, but it does in a new shell:



    jean@myLinux:~$ sudo groupadd tester
    [sudo] password for jean:
    jean@myLinux:~$ sudo usermod -a -G tester jean
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
    jean@myLinux:~$ su - jean
    Password:
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1003(tester)





    share|improve this answer














    You don't need to reboot to assign the additional group to your user. In the running shell the group assignment doesn't change, but it does in a new shell:



    jean@myLinux:~$ sudo groupadd tester
    [sudo] password for jean:
    jean@myLinux:~$ sudo usermod -a -G tester jean
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
    jean@myLinux:~$ su - jean
    Password:
    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1003(tester)






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 10 at 14:45

























    answered May 10 at 14:36









    muclux

    2,1231521




    2,1231521











    • That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
      – Dan
      May 10 at 15:00
















    • That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
      – Dan
      May 10 at 15:00















    That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
    – Dan
    May 10 at 15:00




    That part I understand, but what I don't understand is how come I wasn't assigned to the new group after I logged out and then logged back in.
    – Dan
    May 10 at 15:00












    up vote
    0
    down vote













    You can also use the newgrp command to join a new group:



    jean@myLinux:~$ id
    uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
    jean@myLinux:~$ newgrp - newgroup
    jean@myLinux:~$ id
    uid=1000(jean) gid=1003(newgroup) groups=1003(newgroup),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1000(jean)


    I must confess that I'm as surprised as you that logout / login doesn't assign the new group, but su - does.






    share|improve this answer
























      up vote
      0
      down vote













      You can also use the newgrp command to join a new group:



      jean@myLinux:~$ id
      uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
      jean@myLinux:~$ newgrp - newgroup
      jean@myLinux:~$ id
      uid=1000(jean) gid=1003(newgroup) groups=1003(newgroup),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1000(jean)


      I must confess that I'm as surprised as you that logout / login doesn't assign the new group, but su - does.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        You can also use the newgrp command to join a new group:



        jean@myLinux:~$ id
        uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
        jean@myLinux:~$ newgrp - newgroup
        jean@myLinux:~$ id
        uid=1000(jean) gid=1003(newgroup) groups=1003(newgroup),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1000(jean)


        I must confess that I'm as surprised as you that logout / login doesn't assign the new group, but su - does.






        share|improve this answer












        You can also use the newgrp command to join a new group:



        jean@myLinux:~$ id
        uid=1000(jean) gid=1000(jean) groups=1000(jean),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers)
        jean@myLinux:~$ newgrp - newgroup
        jean@myLinux:~$ id
        uid=1000(jean) gid=1003(newgroup) groups=1003(newgroup),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),129(vboxusers),1000(jean)


        I must confess that I'm as surprised as you that logout / login doesn't assign the new group, but su - does.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 10 at 15:12









        muclux

        2,1231521




        2,1231521






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034463%2fwhy-didnt-my-user-get-assigned-to-the-group-i-had-added-myself-to%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491