You are on page 1of 3

Class 11

Permission

Types of permission

1. Read = see the data = r =4


2. Write = edit the data = w = 2
3. Execute = folder (come to inside the folder ) , file = simple , shell scripting (it apply only in shell scripting
file) = 1
4. No permission = nothing = 0

See the permission

Mkdir /software

Ls -l or ll (long listing)

drwxr-xr-x. 2 root root 6 Jan 23 05:34 software

d = directory , - = file , l = soft link

rwxr-xr-x = permission

. = + = ACL

2 = subfolder

Root = owner

root = group

6 = size in byte

Jan 23 05:34 = creation date and time

Software = name

Rwx r-x r-x

Privilege non-privilege system-user

Change the permission

1. Numerical method
2. Symbolic method
1. Numerical method
Read = r =4
Write = w = 2
Execute = x = 1
No permission = - = 0
Rwx = 4+2+1 = 7
r-x = 4+0+1 = 5
r-x = 4+0+1 = 5
rwxr-xr-x =755

r-- = 4
-wx = 3
--x = 1
--- = 0
-w- = 2

Rwx—x—x = 711
Change the permission = chmod (change modification)

Rwxrwxrwx = 777

2. Symbolic method
Privilege user = root = user = u
Non-privilege = group = g
System user = other = o

Add the permission


Chmod u+wx /software

Remove the permission


Chmod u-w /software

Apply same permission


Chmod u=rw /software

U=rw g = w o=rwx

Chmod u=rw,g=w,o=rwx /software

U= x , w = x , o =x
Chmod u=x,g=x,0=x /software
Chmod ugo=x /software

Ugo = a
Chmod a=x /software

Chmod -x /software

Special permission
Suid = set user identification
Sgid set group identification
Sticky bit

SUID = set user identification = it is use to give privilege user permission to all non-privilege user . Kernel
understand it by 4 no .
Root = usradd , groupadd , init 6 , init 0
Ducat =
Sudo
Groupadd = which groupadd
/usr/sbin/groupadd
Ll
rwxr-xr-x = 755
chmod 4755 /usr/sbin/groupadd
rwsr-xr-x = s show in 1 block means suid applied

s = suid + execute
S = suid

Sgid = set group identification = apply same group to subdata , kernel understand it 2 no

Group = IT
User -= aa bb
Usermod -G IT aa
Mkdir /data
Chgrp IT /data

Chmod 777 /data


Su - aa
Cd /data
Touch test1

Chmod 2777 /data


Rwxrwsrwx = s show in 2 block means sgid applied

S = SGID
s = execute + suid

Sticky bit = only owner can delete the data . kernel give it 1 no .

Chmod 1777 aws

Rwxrwxrwt = t show in 3 block means sticky bit applied

T = sticky bit

t = sticky bit+ execute

Pemission , special permission

You might also like