Wednesday, November 23, 2011

User Group and Permission

User :- User is an object who can access resources of our system

* When we Create a user system create a home directory for that particular user with same user name
* When we Create a user system create a group for that particular user with same user name
There are four types of user
1.Super user
2.Normal User
3.System User
4.Normal User

* All user unique UID

0 - root user
1-499 - system user
500-60000 Normal user
60001-65535 Duplicate user

* All user info store in /etc/passwd file

* /etc/passwd are 7 clone separated field


root:x:0:0:root:/root:/bin/bash

1.User name

2.Password

3.UID

4.GID

5.User common Info

6.User home directory

7.Login shell

To get info abut any user
---------------------------------
#getent passwd
or
#vipw
or
#vim /etc/passwd

Group:-Group is a contener which holds some permission object

  • Each user assign a group or more than one group
  • By default each user belong to therir primary group with same user name
  • all info of group are store in /etc/group
  1. Primary Group (Default created)
  2. Secondary Group (Manually created)
  • each group assign a unique GID
0 ----> root
1-499 ----> system group
500-60000 ----> Normal group
60001-65535 ----> Duplicate group

Group informatation store in /etc/group

root:x:0:root
1.Group name
2.Group password
3.GID
4.Group Member

To creat a group
#groupadd
Todelet the group
#groupdel
To get info abut any group
#getenet group
or
#vigr
or
#vim /etc/group

PERMISSION
To see the permission
#ls -lh
or
#ls -lh
or
#ls -ldh /etc



There are 8 clone seprated field each field denoted by difrent colour

1. 7 Type of file
d -----> Directory
- ----> Normal file
l -----> Link file
b ----> block special file
c ----> character special file
p ---->Normal pipe file
s ---->Socket file

2. Permission
3.No of link count
4.Owner of the file or directory
5.Group owner of the file or directory
6.Size of the file or directory
7.Last access or modify date & time
8.file or directory name

2 comments: