Linux groups

To see lists all groups that a user is in, run

groups USER_HERE

Example

boby@sok-01:~$ groups boby
boby : boby adm cdrom sudo dip plugdev lpadmin lxd sambashare libvirt docker
boby@sok-01:~$ 

To add a user to a group, run

adduser USER_NAME GROUP_NAME

Example

root@vagrant:~# adduser boby sudo
Adding user `boby' to group `sudo' ...
Adding user boby to group sudo
Done.
root@vagrant:~# 

To remove a user from a group

deluser USER_HERE GROUP_HERE

Example

root@vagrant:~# deluser boby sudo
Removing user `boby' from group `sudo' ...
Done.
root@vagrant:~# 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *