Top Ad unit 728 × 90

Latest updates

recent

PERMISSIONS PRACTICAL STEPS


#### BASIC PERMISSION ####

'### APPLYING A BASIC PERMISSION ON DIRECTORY ###'
# useradd tom (create one user)
# su - tom (login as a user)
# cd /root (try to access root dir)
# exit (logout)
# ls -ld /root (check the permission)
(1)To Apply Execute Permission on Directory
# chmod 751 /root
# ls -ld /root (to check)
# su - tom
# cd /root (try to access)
# ls (to read - ERROR)
# exit (logout)
(2)To Apply Read & Execute Permission on Dir
# chmod 755 /root
OR
# chmod u=rwx,g=rx,o=rx /root
# ls -ld /root (to check)
# su - tom
# cd /root
# ls (to read)
# touch tom (to write - ERROR)
# exit (logout)
(3)To Apply Read,Write & Execute Permission on Dir
# chmod 777 /root
OR
# chmod u=rwx,g=rwx,o=rwx /root
OR
# chmod a=rwx /root
# ls -ld /root (to check)
# su - tom
# cd /root
# ls (to read)
# touch tom (to write)
# exit (logout)


'#### BASIC PERMISSION ON FILE ####'
# cat > linux (create one file in /root dir)
# su - tom
# cd /root
# cat linux (to read)
# cat >> linux (to write - ERROR)
# exit
# ll linux (check the permission)
To Apply Read & Write Permission file
# chmod 666 linux
# ll linux (to check)
# su - tom
# cd /root
# cat linux (to read)
# cat >> linux (to write)
# exit


'#### TO CHANGE THE OWNER OF THE FILE ###'
Create 3 more users (for ex:a1,a2,a3)
# cat > unix (create one more file in /root)
# ll unix (check the permission)
For the User:a1-rw permission on unix file
# chown <username> <filename>
# chown a1 unix
# ll linux (to check)
# su - a1 (to check-login as a user)
# cd /root
# cat unix (to read)
# cat >> unix (to write)
# exit (logout)


'#### TO CHANGE THE GROUP OWNER OF THE FILE ####'
For the User:a2,a3-zero permission on unix file
# groupadd zoom (create one group)
# gpasswd -M a2,a3 zoom (add two users in group)
# chgrp <groupname> <filename>
# chgrp zoom unix (to change group owner)
# chmod 604 unix (provide zero permision in group)
# ll unix (to check)
To Check the Result Login As a User:a2,a3 and access the unix

file in /root directory

###### ADVANCE PERMISSION ######

TO APPLY ADVANCE PERMISSION ON DIRECTORY
# chmod 1777 /root
'1'for applying advance (sticky bit) permission only on
directories to avoid data deleting
# ls -ld /root
't'sign is the indication of Advance Permission
# su - tom (login as a normal user)
# cd /root (access root directory)
# rm -rf * (try to remove the data)
# exit (logout)


###### ACL PERMISSION ######

Create 6 Users (for ex:a1 to a6)
# cat > linux (create one file in /root)
# ll linux (to check the permission)

'For the User:a1 - Read & Write Permission'
# setfacl -m u:a1:rw linux (to assign acl)
# ll linux (to check)

'+'sign is the indication of acl permission
# su - a1 (to check-login as a user)
# cd /root
# cat linux (to read)
# cat >> linux (to write)
# exit (logout)

'For the User:a2 - Read & Execute Permission'
# setfacl -m u:a2:rx linux
# getfacl linux (to check acl permission in detail)
Login as a User:a2 & Check the Result

'For the User:a3 - Read,Write & Execute Permision'
# setfacl -m u:a3:rwx linux
# getfacl linux (to check)
Login as a User:a3 & Check the Result

'For the User:a4 - Write Permission'
# setfacl -m u:a4:w linux
# getfacl linux (to check)
Login as a User:a4 & Check the Result

'For the User:a5,a6 - Zero Permission'
# groupadd zoom (create one group)
# gpasswd -M a5,a6 zoom
# setfacl -m g:zoom:0 linux (to assign on group)
# getfacl linux (to check)
Login as a user:a5,a6 & check the result

'To Remove the ACL Permission from single user'
# setfacl -x u:a4 linux (to remove)
# getfacl linux (to check)

'To Remove the ACL Permission Completely from file'
# setfacl --remove-all linux
# getfacl linux (to check)

# ll linux (to check)
PERMISSIONS PRACTICAL STEPS Reviewed by Unknown on 10:31 AM Rating: 5
© 2007 - 2016. All Rights Reserved by Babashaheer Blog

Contact Form

Name

Email *

Message *

Powered by Blogger.