System Grab Bag

View all TLDR pages from Linux (or from all pages)

useradd

Create a new user. See also: users, userdel, usermod. More information: https://manned.org/useradd.
  • Create a new user:
    sudo useradd {{username}}
  • Create a new user with the specified user id:
    sudo useradd --uid {{id}} {{username}}
  • Create a new user with the specified shell:
    sudo useradd --shell {{path/to/shell}} {{username}}
  • Create a new user belonging to additional groups (mind the lack of whitespace):
    sudo useradd --groups {{group1,group2,...}} {{username}}
  • Create a new user with the default home directory:
    sudo useradd --create-home {{username}}
  • Create a new user with the home directory filled by template directory files:
    sudo useradd --skel {{path/to/template_directory}} --create-home {{username}}
  • Create a new system user without the home directory:
    sudo useradd --system {{username}}

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.