ADVANTAGE PRO – Chennai’s Premier Networking Training Centre

Useradd :
To create a new user account and login directory for that
new account.
Useradd will create new entries in system files.
Syntax
useradd [options] [user]
Options
-c Comment field.
-d Home directory
-e Account expiration date.
useradd command
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Passwd comand
Passwd:
The passwd command is used to set the password for the user.
Syntax
passwd <username>
Example:
#passwd tom
- this example set password for tom user.
#passwd
- this example set password for current loin user.
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Userdel command
Userdel
The userdel command is used to delete a user account
Syntax
userdel -r. <username>
Example
userdel –r tom
- this command delete user account as tom
userdel tom
- this command delete user account tom but can not
delete a home directory of tom user.
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
User configuration files
When a new user account is created, its
entries updates the following system files.
- /etc/passwd
- /etc/group
- /etc/shadow
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Creating groups
New group is created by hand-editing the file /etc/group or by using
groupadd command.
 Syntax:
groupadd groupname

groupdel command is used to remove the group.
Syntax
groupdel groupname

Groupmod is used to rename the existing groupname.
Syntax:
groupmod –n newname oldname



ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
chage command
The chage command let you specify an expiration limit for a user's
account and password .

Syntax:
chage [option] username
Option
-l lists the current password expiration.
-m set the min. days to change the password.
-M set the max. days to change the password.
-E specific expiration date for user account.
-I set inactive period (in days)
-W warning period, number of days before
expiration.

ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Set userID
It allows an executable file to run under the user or group security
context with the permission of its owner.


SUID can be set as follows:
chmod u+s [filename]
(or)
chmod 4xxx [filename]
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Set groupID
Set groupID
Set groupid are also set to directory, any user creating file in that
directory, the file group is directory group name.
SGIP can sets as
chmod g+s directory
or
chmod 2xxx directory
ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Sticky bit
Sticky bit:
Stricky bit is set to the directory, so that only the owner can
delete their own file even the others have write permissions.
Sticky bit can sets as
chmod +t directory
or
chmod 1xxx directory

ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Switch user
su command is used to switch to another account from the
command line.
This command is most often used by system administrator to
temporarily become the root user without logging out of their non-
privileged account.
Syntax
su - [user] -c command

ADVANTAGE PRO – Chennai’s Premier Networking Training Centre
Multi user login
Like unix operating system where multi user login can be done, in
same sense the Linux operating system supports multi user login.

Each user can login in each terminal and can do multi processing
which avoids logging off from the system.