Adding and Modifying Users and Groups in Linux

Adding and Modifying Users and Groups is a core systems administration task. The act of adding a user and group is fairly easy however there are some tricks that help make the long-term management of users easier. Tips for easier management Keep user attributes consistent amongst all systems A common mistake sysadmins make when building a new environment is they will allow uid's, gid's, home directories and other user attributes to be mis-matched from system to system.

usermod: Appending to Additional Groups

This is one of those things that I found out the hard way long long ago. When using the usermod command in Linux to add additional groups if you want to only list the new groups the user is in you must use the -aG flags rather than a simple -G. When specifying -G by itself you are telling usermod to change the users additional groups to the groups specified and only those groups.