This post has already been read 1248 times!

To list all local users you can use:

List all local users
cut -d: -f1 /etc/passwd

To add a new user you can use:

Add New User
sudo adduser new_username


sudo useradd new_username

To remove/delete a user, first you can use :

Remove/Delete a User
sudo userdel username

Then you may want to delete the home directory for the deleted user account :

Remove the home directory for username
sudo rm -r /home/username

To modify the username of a user:

Modify the Username of a User
usermod -l new_username old_username

To change the password for a user:

Change password for username
sudo passwd username

To change the shell for a user:

Change the SHELL for a User
sudo chsh username

To change the details for a user (for example real name):

Change details for a User
sudo chfn username

To add a user to the sudo group:

Add a user to the SUDO group
usermod -aG sudo username

Leave a Reply

Post Navigation