Linux user group management
mouse 527 · person cloud · link
Last update
2020-03-16
2020
03-16
« — »
1
2
3
4
5
6
7
8
9
10
# on Debian/Ubuntu
addgroup groupname             # create a new group
adduser username grouptoadd    # add username to grouptoadd
deluser username grouptoremove # remove username from grouptoremove

# on CentOS
/sbin/usermod -aG grouptoadd username # add username to grouptoadd
id -nG username                       # show groups, eg: g1 g2 g3
/sbin/usermod -G g1,g2 username       # remove username from group "g3"
id -nG username                       # show groups, eg: g1 g2