Document 3.0 Computer Networking Lab 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Experiment no.

:03
Date:
AUTHENTICATION AND AUTHORISATION
Aim: To familiarise the commands to provide Authentication and
Authorisation.
1) List all the users in the system.
Commands for list all users
 #cat /etc/passwd

 #getent passwd

 #cat /etc/shadow(encrypted password)


2) List all the group in the system.
Commands for list all group
 #cat /etc/group

 #getent group
3) Find details of login users.
Commands to get details of login users
 #who –(list all logged in users.)

 #w –(provide wide information.)

 #pinky -(provide more information.)

 #whoami –(showing which user is.)

4) Create 5 groups.
Commands for create group.
 #groupadd groupname.

5) Create 6 users (3 each using both commands)


Commands for create users
 #sudo useradd username –(a new group with same name will
created)
 #useradd -G groupname username

 #useradd -G grp1.,grp2,grp3 username

 #adduser user11 –( ask for password and other informations)


6) Change password of all users.
Command for chage password.
 #passwd username –(chage user password and set
password)
7) Assign each users to any two groups.
Command to assign users to group.
 #usermod -a -G group1 group2 group3 username

(Add user to multiple group) .


8) Change primary group of any two users.
Command to change primary group of any two users
 #usermod -g group username –(lowercase g for assign
primary group)
9) Create additional two users.
Command to create users
 #sudo useradd username -(Adding new user)
10) Create additional two groups.
Command to create groups.
 #groupadd groupname. -(adding new group)
11)Remove new user.
Command to remove user.
 #userdel username. –(remove user)
12) Remove new group.
Command for remove group
 #groupdel groupname. –(remove group)
13) Create 5 directories in user home directory.
Commands create directory.
 #mkdir –(to make directory)

14) Create 6 files in each directory.


Command to create file
 #touch filename –(to create empty file) .
15) Grand read/write/execute permission to 2 users on all
directories and files.
Command to grand permission.
 #Chmod 777 filename. –(read write and execute permission ).
16) Grand read/write permission on all files of any two directory
to all users.
Commands.
 #chmod 660 filename –(read write permission) .
RESULT: familiarised Authentication and Authorisation successfully.

You might also like