0% found this document useful (0 votes)
29 views2 pages

Steps To Create New User - Group

The document provides instructions for adding new users and groups to a system using the useradd and groupadd commands. It describes: 1) The useradd command syntax including required and optional arguments like -d to set the home directory, -m to create it, -s to set the shell, -g for the primary group, and -G for secondary groups. 2) Examples of adding a new user with and without options. 3) The groupadd command for creating a new group. 4) Commands for viewing a user's groups like groups and grep.

Uploaded by

Goonj Choudhary
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Steps To Create New User - Group

The document provides instructions for adding new users and groups to a system using the useradd and groupadd commands. It describes: 1) The useradd command syntax including required and optional arguments like -d to set the home directory, -m to create it, -s to set the shell, -g for the primary group, and -G for secondary groups. 2) Examples of adding a new user with and without options. 3) The groupadd command for creating a new group. 4) Commands for viewing a user's groups like groups and grep.

Uploaded by

Goonj Choudhary
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Commands to add a new user / group

useradd - This command is used to add a new user. syntax - useradd -d /export/home/userid -m -s /bin/ksh -g groupname -c "user decription" userid There are the following options can be used with useradd command -d home directory (to specify the path of home directory)

-m make directory ( to create the home directory) -s -g -c shell (it's optional and used to chnage the default shell) primary group (to add the primary group) comments (to add the user description) For IBM users - -c "897/I/serial no.//userid [IBM" eg. -c "897/I/6C7727//Robert Blake [IBM" -c "897/I/XXXXXX//Robert Blake [IBM" For Non Ibm user - -c "897/C//Agency name/ [User name" eg. -c "897/C//DHR/ [Brandye Orr"

-G secondary group (to add a secondary group) e.g. sudo useradd testuser (To create an user without any option.) e.g. sudo useradd -d /export/home/testuser -m -s /bin/ksh -g idadmin -G dba -c "Test User, IBM DBA" testuser * sudo command is used to get the root privileges. Whenever we use sudo with any command user needs to enter his/er password after entering the command. groupadd - This coomand is used to add a new Group. eg. sudo groupadd newgroup

NOTES - groups userid (To view the all added group in user account.) eg. groups testuser. grep userid /etc/group (To view the all added groups in user accounts) eg. grep testuser /etc/group

NOTES - ssh_access group to access all the servers User can have only one primary group and multiple secondary groups. /usr/sadm/defadduser file displays all the default values that can be assigned to a new user.

************************************************************************************************************************

You might also like