Why can't I add user to group?

Smoot Carl-Mitchell smoot at tic.com
Thu Apr 30 14:38:24 UTC 2009


On Thu, 2009-04-30 at 14:53 +0300, Dotan Cohen wrote:
> jaunty2 at laptop:~$ whoami
> jaunty2
> jaunty2 at laptop:~$ sudo usermod -a -G vboxusers jaunty2
> jaunty2 at laptop:~$ groups
> jaunty2 adm dialout cdrom plugdev lpadmin admin sambashare
> jaunty2 at laptop:~$
> 
> Why is that? I'm on Kubuntu 9.04.

Adding a user to a group does not affect the current session, since the
additional groups are added to your shell process at login.  Logout and
log back in and you will see the added group.

This is necessary because adding groups must be done by a privileged
process.  If an unprivileged process could add groups, it would be
trivial to subvert security.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list