Skip to main content
Engineering LibreTexts

02-B.5: Users: Create, Modify, and Delete

  • Page ID
    26807
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    EXAM OBJECTIVES COVERED
    2.2 Given a scenario, manage users and groups.
    3.1 Given a scenario, apply or acquire the appropriate user and/or group permissions and ownership.

    Create Users

    If we are to use Linux, we must be able to create new user accounts. To do this we use the useradd command. In addition this command allows us to assign basic settings for a user. Many of the Debian distros use the adduser command instead, although the useradd command is still available.

    adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility is more efficient in properly creating new users on Linux. Default parameters for all new users can also be set through the adduser command. Since we are focusing on standard Linux, we will discuss the useradd command.

    There are several files that are used in the creation of a new user:

    • /etc/passwd - User account information.
    • /etc/shadow - Secure user account information.
    • /etc/group - Group account information.
    • /etc/gshadow - Secure group account information.
    • /etc/default/useradd - Default values for account creation.
    • /etc/skel/ - Directory containing default files.
    • /etc/subgid - Per user subordinate group IDs.
    • /etc/subuid - Per user subordinate user IDs.
    • /etc/login.defs - Shadow password suite configuration.

    Depending on the contents and configuration of the /etc/login.defs file, the useradd command may not actually create a home directory. The new user's shell is set to the default /bin/sh and a password will not be created for the new user.

    This video walks through the process of adding a user in detail and shows examples. 

     


    This page titled 02-B.5: Users: Create, Modify, and Delete is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Patrick McClanahan.

    • Was this article helpful?