Linux user management commands

This post will contain a list of common unix commands for user management that I didn't use that often, but that are pretty common for others. And just to prevent me from searching again in the web I will collect them here for myself.

These are commands for creating users and adding users to groups. Please make sure to run the command adduser, passwd and deluser with super-user permissions. On Ubuntu for example with sudo if you are not the root user.

Create a new user

The following command will create a new USER.

adduser USER
Adding user `USER' ...
Adding new group `USER' (1001) ...
Adding new user `USER' (1001) with group `USER' ...
Creating home directory `/home/USER' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for USER
Enter the new value, or press ENTER for the default
	Full Name []:
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n]

Add an existing user to an existing group

This command will add an existing USER to an existing GROUP.

adduser USER GROUP
Adding user `USER' to group `GROUP' ...
Adding user USER to group GROUP
Done.

Set a new password

This command will update the password of an existing USER.

passwd USER
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Delete a user

The following command will delete user USER.

deluser USER
Removing user `USER' ...
Warning: group `USER' has no more members.
Done.
Next Previous