0

I really don't understand.

I have on my localhost web projects on the path /var/php/project_name

I have changed ownership of that files to my user name via chown. Now, assume I have private directory inside project (so the path is /var/php/project_name/private)

and I type command:

chmod -R u=rwx,g=rx,o= private 

so the permissions are:

drwxr-x--- 4 maciej maciej 4096 2012-02-02 11:54 private 

but when I try to cd private i get permissions denied. What the f... is going on?

Yes, I am logged as maciej: maciej@mkk:/var/php/edited_name/private$

OS: newest Ubuntu

UPDATE:

sorry guys - it was my typo.. i lied to you: i removed x permission but included it in the question :|

3
  • try bombing the permissions with a chmod 777 and see if anything happens. Commented Feb 29, 2012 at 13:37
  • Read (r) has nothing to do with accessing a directory. It's the execute (x) bit that allows you to cd into a directory. What happened to you doesn't happen to me though.... Commented Feb 29, 2012 at 13:42
  • @Migs your comment was answer - i lied to you all in the question, my bad.. please make this comment an answer and I will accept it Commented Feb 29, 2012 at 13:48

3 Answers 3

2

Read (r) has nothing to do with accessing a directory. It's the execute (x) bit that allows you to cd into a directory.

0

Only user maciej and group maciej are allowed to enter private. Are you logged in as maciej?

1
  • yes, I am: maciej@mkk:/var/php/edited_name/private$ Commented Feb 29, 2012 at 13:33
0

It works for me as you've written it:

/tmp/mkk $ mkdir private /tmp/mkk $ chmod -R u=rwx,g=rx,o= private/ /tmp/mkk $ id uid=1000(nick) gid=100(users) groups=... /tmp/mkk $ ls -l total 4 drwxr-x--- 2 nick users 4096 Feb 29 13:32 private /tmp/mkk $ cd private/ /tmp/mkk/private $ 

Are you definitely logged in as the maciej user? Are you running SELinux or similar?

2
  • yes i am, that is why it is strange to me. maybe it is because I do not own parent folder - var? but this would be strange Commented Feb 29, 2012 at 13:36
  • Well, could you add the output of ls -ld /var/php/project_name/{,private} to the question just in case? Commented Feb 29, 2012 at 13:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.