CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
sudo usermod -l new-username old-username
To change the users directory name do the following.
sudo usermod -d /home/new-username
You might need to log in as root or another user to successfully execute the commands.
sudo useradd -m newuser
The -m option create the new users home directory
Then to activate the user we need to setup a password.
sudo passwd newuser
Enter and reenter the password and your done.
If you need to add the user to a certain group(s) (sudo?) you can do that with usermod
sudo usermod -G sudo,othergroups newuser
sudo userdel -r username
The “-r” option deletes the users mail and home directory. If you wanted to keep them then just discard that option.