Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 :|

share|improve this question
    
try bombing the permissions with a chmod 777 and see if anything happens. –  qweet Feb 29 '12 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.... –  Migs Feb 29 '12 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 –  mkk Feb 29 '12 at 13:48
    
@mkk Thanks, posted as an answer just now. –  Migs Feb 29 '12 at 13:51

3 Answers 3

up vote 2 down vote accepted

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

share|improve this answer

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

share|improve this answer
    
yes, I am: maciej@mkk:/var/php/edited_name/private$ –  mkk Feb 29 '12 at 13:33

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?

share|improve this answer
    
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 –  mkk Feb 29 '12 at 13:36
    
Well, could you add the output of ls -ld /var/php/project_name/{,private} to the question just in case? –  nickgrim Feb 29 '12 at 13:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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