November 18

Linux: Basic User administration

Basic User administation

Delete a user:
userdel username
Be sure to delete the home folder if it is no longer in use

Add a user:
useradd username

Add user to specific gid and uid:
groupadd -g 2501 username ; useradd username -u 501 -g 2501 -m -s /bin/bash

Add a group:
groupadd groupname

Add a user to a group:
usermod -a -G groupname username

Change the default group for a user
usermod -g groupname username

If adding to administrator/wheel:
Use: visudo

Remove the # in front of “# %wheel ALL=(ALL) ALL”
Allows people in group wheel to run all commands

Add user to the wheel group:
usermod -aG wheel username

Change or add a users full name. Also called the finger name:
chfn -f “Joe Blow” jblow
usermod -c “Snow John” username


Copyright 2021. All rights reserved.

Posted November 18, 2021 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B