Linux user group management
mouse 321 · person cloud · link
Last update
2018-06-12
2018
06-12
« — »
1
2
3
4
5
6
7
8
9
# on Debian/Ubuntu
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