Name
useradd [options
] username
— shadow-utils
Synopsis
/usr/sbin
stdin stdout - file -- opt --help --version
The useradd
command lets the superuser create a new 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 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 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.