Name
useradd — stdin stdout - file -- opt --help --version
Synopsis
useradd [options
]username
The useradd
command lets
the superuser create a user account.
# useradd smith
Its defaults are not very useful (run useradd -D
to see them), so be sure to
supply all desired options. For example:
# useradd -d /home/smith -s /bin/bash -g users smith
Useful options
|
Set the user’s home
directory to be
|
|
Set the user’s login
shell to be |
|
Set the user’s ID to
be |
|
Set the user’s
comment field (historically called the GECOS field).
This is usually the user’s full name, but it can be any
string. The |
|
Set the user’s
initial (default) group to |
|
Make the user a
member of the additional, existing groups
|
|
Copy all files from
your system skeleton directory, /etc/skel, into
the newly created home directory. The skeleton directory
traditionally contains minimal (skeletal) versions of
initialization files, like ~/.bash_profile, to get new users
started. If you prefer to copy from a different directory,
add the |
Get Linux Pocket Guide, 2nd Edition 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.