Creating a user with the useradd command

The useradd command, when run without options, creates a user account with default parameters. The default parameters are read from the /etc/login.defs file and include parameters such as valid UID, GID number, default password aging rules, and so on. Values from this file are used while creating a new user only. The syntax of useradd is as follows:

$ useradd    <username>

useradd --help will display options that can be used with the useradd command to override the default parameters.

An example of using the useradd command to create a user account is shown in the following screenshot:

Apart from useradd ...

Get CentOS Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.