Skip to main content
Engineering LibreTexts

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

  • Page ID
    26807
  • 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.

     

    • Was this article helpful?