Sunday 2 October 2011

File Permissions in Linux


File Permissions

Ability to restrict/control access to files.

File Type Permission

10 bits represents , ability to restrict/control.

ls -l to examine permissions


-rwxrwxr-x

bits order

1.      =file type "- file , d directory"

rwx

2-4.   = owner's permissions

 r=read =4
 w=write =2 ==>> 7
 x=execute=1
- = none = 0

rwx
5 - 7  = group owner's permissions
 r= read = 4
 w= write =2 ==> 7
 x=execute =1
 - = none =0

r-x

8 - 10  = everyone permissions

 r= read = 4
 w= write =2 ==> 5
 x=execute =1
-=none=0



chmod 664
chmod 775


user = u
other =o everyone
group=g

chmod  u+rwx ( user read+write +execute)

chmod a+rwx   everyone 777

prefix 5
755
chmod 2755 /sales

mkdir /sales

==========================

chown = permits changing of ownership                                     of files

chown -R newowner filenames

R= recursive


===========================

/var/www/html

change ownership of different files.

chown apache:apache /var/www/html -R

No comments:

Post a Comment