Copied to clipboard

adduser

`adduser` command line is used to create a new user on Linux system.
Leave blank to assign a UID automatically

Examples

  • Create a new user and add them to an existing group:

    sudo adduser username groupname
    
  • Create a new user and set their password during creation:

    sudo adduser username --password password
    
  • Create a new user and add them to multiple groups:

    sudo adduser username group1 group2 group3
    
  • Create a new user and specify their default shell:

    sudo adduser username --shell /bin/bash
    
  • Create a new user and set the path for their home directory:

    sudo adduser username --home /path/to/home
    
  • Create a new user and specify their UID:

    sudo adduser username --uid UID
    
  • Create a new user and specify a comment field:

    sudo adduser username --comment "comment"
    
  • Create a new user and add them to a new group:

    sudo adduser username --ingroup groupname