To create a new user account in Unix, you can use the useradd
command.
For example, to create a new user account with the username bob
, you can use the following command:
useradd bob
This will create a new user account with the username bob
, as well as a home directory (/home/bob
) and a default set of permissions and settings.
You can also use the -m
option to create the user's home directory and copy over the default configuration files from the /etc/skel
directory. For example:
useradd -m bob
You can also use the -g
option to specify a primary group for the user, and the -G
option to specify additional groups for the user to belong to. For example:
useradd -m -g users -G wheel bob
This will create a new user account with the username bob
, create a home directory for the user, and assign the user to the users
and wheel
groups.
Overall, the useradd
command is a useful tool for creating new user accounts in Unix. It has many other options and features that allow you to customize the user's permissions and settings.