DEV Community

Jeg
Jeg

Posted on

Creating Linux user without home directory

To create a linux user without home directory:

sudo useradd --no-create-home john
or
sudo useradd -M john

sudo: Grants administrative privileges.
useradd: Adds a new user
-M or --no-create-home: Skips creating a home directory for the new user.
john: Creates a new user named john.
Enter fullscreen mode Exit fullscreen mode

Reference URL: https://linuxsimply.com/ubuntu-create-user-without-home-directory/

Top comments (0)