Linux - How to create a user with all fields, Create user with comment and home directory

How to create a user with all fields


To create a user by specifying different home directory and by specifying the user details with his name and other details use the below command.

Syntax:
useradd -m -d <home directory> -u <user-Id> -s <shell> -c "<comment on user/details>" <username>
Example:
useradd -m -d /data/home/admin -u 555 -s /bin/bash -c "W3calculator Admin" admin

Where,

-d used to specify the user home directory
-u specifies the user id
-s used to specify the shell access
-c used to make comment on user or to specify the details of the user.

The topic on Linux - How to create a user with all fields is posted by - Math

Hope you have enjoyed, Linux - How to create a user with all fieldsThanks for your time

Tech Bluff