Module Four - Session 14: Manipulating File Access

What will I be learning?

You will learn more about how Linux manages files. We will discuss how to control access to files and manage ownership of files.

Test your self with setting file permissions both ways. Try to answer these questions and then do it on a Linux system to see if your commands work.

After this section I should be able to...

Successfully be able to set file permissions and control access to files.

What should I practice?

Practice these CLI (commandline interface) commands:
























































Permission Questions

1) Write the command by using letters (symbolic) to set the following permissions:

            I.    rwxrwxr-x :

 

           II.    rwxr--r-- :

 

         III.    r--r----- :

 

           IV.    rwxr-xr-x :

 

            V.    r-x--x--x :

 

           VI.    -w-r----x :

 

         VII.    -----xrwx :

 

2) Write the command by using octal numbers to set the following permissions:

            I.    rwxrwxrwx :

 

           II.    --x--x--x :

 

         III.    r---w---x :

 

           IV.    -w------- :

 

            V.    rw-r----- :

 

           VI.    rwx--x--x :

 

Answers can be found here.
























































Answers

1) Write the command line by using letters (symbolic) with chmod to set the following permissions:

            I.    rwxrwxr-x : chmod ug=rwx,o=rx

 

           II.    rwxr--r-- : chmod u=rwx,go=r

 

         III.    r--r----- : chmod ug=r,o-rwx

 

           IV.    rwxr-xr-x : chmod =rx,u+w

 

            V.    r-x--x--x : chmod =x,u+r

 

           VI.    -w-r----x : chmod u=w,g=r,o=x

 

         VII.    -----xrwx : chmod u-rwx,g=x,o+rwx

 

2) Write the command line by using octal numbers with chmod to set the following permissions:

            I.    rwxrwxrwx : chmod 777

 

           II.    --x--x--x : chmod 111

 

         III.    r---w---x : chmod 421

 

           IV.    -w------- : chmod 200

 

            V.    rw-r----- : chmod 640

 

           VI.    rwx--x--x : chmod 711


Original webpage by Petersen Gross, modified by William Albritton.