Linux Make New User Simple Guide How to Create New Users Step by Step

Here's a concise guide for creating new Linux users:

Method 1: Using `adduser` (Recommended for Simplicity)

  • Execute:

    sudo adduser newusername

  • Follow prompts to set password and optional user info (Full Name, etc.).
  • Automatically creates home directory (/home/newusername) and user group.

Method 2: Using `useradd` with Manual Configuration

Basic Creation:

Linux Make New User Simple Guide How to Create New Users Step by Step
  • sudo useradd -m newusername

  • -m: Creates the user's home directory.

Set Password:

  • sudo passwd newusername

  • Enter and confirm the new password securely.

Common Options with `useradd`

  • Specify Home Directory:

    sudo useradd -m -d /custom/path/newusername newusername

  • Assign Specific Login Shell:

    sudo useradd -m -s /bin/bash newusername

    Linux Make New User Simple Guide How to Create New Users Step by Step
  • Add to Supplementary Group(s):

    sudo useradd -m -G group1,group2 newusername

Verification and Confirmation

  • Check User Details:

    id newusername

  • Verify Home Directory:

    ls -ld /home/newusername

  • Test Login:

    su - newusername

Notes:

Linux Make New User Simple Guide How to Create New Users Step by Step
  • Always use sudo for user creation/modification tasks.
  • The adduser script is higher-level and often simpler than direct useradd.
  • Passwords set via passwd are encrypted and stored in /etc/shadow.

Related News