Sunteți pe pagina 1din 11

User and Group Management in Linux

By: Krishan Tripathi


Today I am going to start with the basics of user and group management. This concept plays relevant role in Linux management system. I have created this document which will provide you step by step learning about the access to various users directories. So we are going to start with very small area. We will create two groups having two users each. It could be just like a companys various departments. Here we have two groups Telecom and admin. Each of these groups having two users.

Telecom

Admin

Primary group is admin Secondary group is telecom

KCT and RM (Users)

Kings and BP (Users)

What we have to do, we have to assign secondary group to Admin so that admin users can access the telecom users directories For KCT and RM Telecom is the primary group. In the same way Admin is primary group for KINGS and BP If admin wants to access the user directories and data from the telecom group, he must have the access rights. so to access the directories of telecom users data, telecom must in the secondary group for admin group.

Getting started with the assigned Task


Step 1:- Create two users and two groups To create a user and group , we use to login via root

2) Now we can check the users have been added in the /root/home directory

3) The users have been added in the /root/home directory and we can see the permission criteria as well. drwx= permission for user r-x= group permission r-x= other permission Here r=read . w=write and x= for execution. So for the KCT ,only KCT (user) and access its directories even other group member of telecom cant access so we have to make it accessible to other users as well.

4 ) The below snapshot represents the permission mode.

5) Now we have change the permission mode by the command. Before this kct or user owner only has the access to read and execute the directories but after this command we can assign the permission to the group as well. Chmod - R g=rx /home/kct

6) The same step for user name as RM

7) The same step is performed for all the users

8) Now we have created few directories inside each user (KCT AND RM)

9) Here the permission has been changed from root to KCT to access the Directories

10) Same process repeated for user RM

11) Now see what we are going to do .kings and BP are under Admin groups and now we want to access the telecom users using any one of the admin . I chosen kings , to complete this process i need to assign password to KINGS so that he can log in

Note :- To access the telecom group user by the admin users , it is mandatory that admin group is assigned under SECONDARY group for the admin users.
12) Now the next step is to assign secondary group to the admin users . BP and Kings are the users under admin group

Usermod -aG telecom kings

13) At the below we can see now BP (user of admin group) also having supplementary group or secondary group TELECOM

Note :Now we log in as KINGS and accessed the directory of kct which is the User under TELECOM Group

14) login as kings to check the access to user directory of telecom group

S-ar putea să vă placă și