2 min read
How To Add a New User to Ubuntu

Add a New User to Ubuntu:

sudo adduser username

Example:

sudo adduser john

You’ll be prompted to:

  • Enter and confirm a password
  • Fill optional info (full name, phone, etc.)

That’s it — the user is created with a home directory /home/username

Add User to Sudo Group (for administrative privileges):

sudo usermod -aG sudo username

To confirm:

groups username

Set or reset a user password (if needed):

sudo passwd username

Change username (rarely needed):

sudo usermod -l new_username old_username

Delete a User:

# Remove user but keep files
sudo userdel username

# Remove user and home directory
sudo userdel -r username

Lock/disable and Unlock user account:

# Lock
sudo passwd -l username

# Unlock
sudo passwd -u username