0

I am trying to complete the following task. (I first created the /Homework directory as the root user)

Create a directory named /Homework

mkdir /Homework 

Allow all users to read this directory. But nothing else.

chmod 444 /Homework     

Create three folders inside /Homework

Bob_homework

mkdir Bob_homework

Tim_homework

mkdir Tim_homework 

Ben_homework

mkdir Ben_homework

Give Bob (and only Bob) read and write access to /Homework/Bob_homework

chown Bon: Bob_homework     

setfacl -m u:Bob:rw/Homework/Bob_homework 

Give Tim (and only Tim) read and write access to /Homework/Tim_homework

chown Tim: Tim_homework     

setfacl -m u:Tim:rw /Homework/Tim_homework

Give Ben (and only Ben) read and write access to /Homework/Ben_homework

chown Ben: Ben_homework

 setfacl -m u:Ben:rw /Homework/Ben_homework

After I did all of these, I still can't get Tim to access his directory. Same goes for Bob & Ben.

Where did I go wrong ? I also have another question.

Even though the permission for the Homework directory is set to 444.

The root user and read,write & execute the Homework directory. How is that possible ?

1

The problem is with

chmod 444 /Homework     

Directories need the x permission in order to cd into them.

So make that

chmod 555 /Homework

(Personally I'd pick 755)

root overrides permissions in this scenario.

  • But why am I required to Allow all users to read this directory. But nothing else. ?? – alkabary Sep 14 '16 at 22:27
  • I mean providing the execution seems to me that I didn't do the task correctly ? – alkabary Sep 14 '16 at 22:28
  • 555 is dr-xr-xr-x which allows people to ls (the "r") and cd ("x") the directory. They're both forms of "read". There is no write access granted. – Stephen Harris Sep 14 '16 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.