Why didn't my user get assigned to the group I had added myself to?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
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
.
gnome groups
add a comment |Â
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
.
gnome groups
I even triedsu - $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
add a comment |Â
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
.
gnome groups
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
.
gnome groups
edited May 10 at 12:04
asked May 10 at 11:54
Dan
6,66334273
6,66334273
I even triedsu - $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
add a comment |Â
I even triedsu - $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
add a comment |Â
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)
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
add a comment |Â
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.
add a comment |Â
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)
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
add a comment |Â
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)
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
add a comment |Â
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)
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)
edited May 10 at 14:45
answered May 10 at 14:36
![](https://i.stack.imgur.com/MATL0.jpg?s=32&g=1)
![](https://i.stack.imgur.com/MATL0.jpg?s=32&g=1)
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
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered May 10 at 15:12
![](https://i.stack.imgur.com/MATL0.jpg?s=32&g=1)
![](https://i.stack.imgur.com/MATL0.jpg?s=32&g=1)
muclux
2,1231521
2,1231521
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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