useradd & usermod commands are used to add and modify the users in linux. When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line plus the default values from the system. Depending on command line options, the useradd command will update system files and may also create the new user's home directory and copy initial files.
By default, a group will also be created for the new user
Syntax of useradd command :
# useradd [options] <user-name>
-c comment
-d home_dir
-e expire_date
-G Secondary group
-s shell
-u uid
-d home_dir
-e expire_date
-G Secondary group
-s shell
-u uid
Example :
Syntax of usermod :
# usermod <options> <user-name>
This command is used to modify the existing users. Options will be same as of “useradd” command
0 comments:
Post a Comment