User administration in unix
The command line tools in Linux are very powerful, and as such come with a lot of options. For the most part, after the initial configuration of the system most of the options are not required except in ‘special’ circumstances. Here is an overview of what is available (in Fedora at least).
Create a new user
Add a user called 'auser' and add them into the secondary groups of 'apache' and 'sudo'
useradd -G apache,sudo auser
Create a new group
Create a new group in the system called 'agroup'
groupadd agroup
Set a users primary group
Set the primary group of 'auser' to 'agroup'
usermod -g agroup auser
Assign a user into an existing group
Add 'auser' into 'agroup' group
gpasswd -a auser agroup
Remove a user from a group
Remove 'auser' from 'agroup'
gpasswd -d auser agroup
Remove a user from the system
Remove 'auser' from the system and remove their home directory, mail spool file and name group if it exists
userdel -r auser


