Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Linux Quiz 4



  

Sit beside a friend for this quiz

We need a different user to test how chmod permissions work.
  


chmod (web dir)

We will test chmod using our web directory:
 $HOME/public_html 

  1. First, there is the issue of the permissions for your home directory.
    If your home directory is blocked to your friend, then it doesn't matter what public_html permissions are, they can't see it.
    What chmod instruction do you need so your friend can access (but not do "ls" in) your home directory?
  2. Next, what chmod instruction do you need so your friend can access (but not do "ls" in) your web directory?
  3. Next, what chmod instruction do you need so your friend can "ls" in your web directory? Test that your friend can do an ls.

  4. What command do you need to stop other people doing an "ls"? Test that your friend cannot do an ls.

  


chmod (web page)

Make a web page in your public_html directory.
If you do not already have a web page there, this command will make one:
  echo "My web page" > $HOME/public_html/index.html
You can then view the web page through the address:
  https://student.computing.dcu.ie/~youruserid 
  
  1. Is my web site visible if I set the directory permissions as follows: chmod go-rwx public_html
  2. Is my web site visible if I set the directory permissions as follows: chmod go-rx+w public_html
  3. Is my web site visible if I set the directory permissions as follows: chmod go-rw+x public_html
  4. Is my web site visible if I set the directory permissions as follows: chmod o-rw+x public_html
  5. Is my web page visible if I set the permission as follows: chmod -rwx file.html
  6. Is my web page visible if I set the permission as follows: chmod u+rwx file.html
  7. Is my web page visible if I set the permission as follows: chmod +r file.html
  8. What is the minimal protection that your public_html directory needs?
  


If you submit by mistake or make an error, just press "Back" and submit again.