Skip to content

Instantly share code, notes, and snippets.

@BenjiTrapp
Forked from wyyder/Create new user in Linux
Created December 1, 2024 14:59
Show Gist options
  • Select an option

  • Save BenjiTrapp/14f91e80aa9208b19efb811b1de2ce8c to your computer and use it in GitHub Desktop.

Select an option

Save BenjiTrapp/14f91e80aa9208b19efb811b1de2ce8c to your computer and use it in GitHub Desktop.

Revisions

  1. @wyyder wyyder created this gist Jan 25, 2020.
    13 changes: 13 additions & 0 deletions Create new user in Linux
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # Add user.
    useradd -m username
    # -m creates a home directory for the user.

    # Set Password.
    passwd username

    # Set user group to sudo.
    usermod -a -G sudo username
    # -a option to add and ‘-G sudo’ means to add the user to the sudo group.

    chsh -s /bin/bash username
    # chsh command is used to change the login shell for a user.