blank logo Hung-Yueh Chiang
  • About
  • Blog(current)
  • Publications
  • Projects

Create/Delete Users on Linux Machines

June 25, 2024

2024   ·   linux   ubuntu   commands  

Create Users

Create user with default using bash shell -s (--shell) and home directory -m (--create-home)

$ sudo useradd -m -s /bin/bash <usrname>
$ sudo passwd <usrname>

Delete Users

Delete that user’s home directory and mail spool by using the -r flag with the command

$ sudo userdel -r <usrname>

Reference:

  • https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/
  • https://sg.godaddy.com/help/remove-a-linux-user-19158
© Copyright 2025 Hung-Yueh Chiang. Powered by Jekyll with al-folio theme. Hosted by GitHub Pages. Last updated: May 02, 2025.