Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to ask you something that's bothering me for the last couple of days. On my system I keep a folder called myscripts under my usual home folder.

What I tried to do is

chmod 500 myscripts

and pressed enter. After that I did

ls -l ~ 

to confirm and I got

dr-x------  2 Konos5 people    2048 Jun 21 22:51 myscripts

From what I understand I now should not be able to write anything within the myscripts folder. However if I type

touch ~/myscripts/hello.txt

the file hello.txt is normally created. How is that happening and what happened to the "no write" permission bit?

And one last thing. Before I change the permissions of that folder I had already kept the infamous youtube-dl script with -rwx- permissions. If I now run the script it will automatically download a youtube video and write it on my disk (within myscripts folder). Again, how is that possible since the folder's permissions are -rx- only?

Thank you in advance

share|improve this question
1  
Are you probably root? Please add the output of whoami or echo $UID. –  speakr Jun 21 '12 at 22:15
    
I am Konos5. Not root. That's why I am confused. –  Konos5 Jun 21 '12 at 22:32

3 Answers 3

up vote 4 down vote accepted

Since you mentioned that you're using your school's server, I suspect your home directory is on AFS. AFS does not respect Unix permissions on directories at all, but there are AFS-specific permissions you can use instead. For example, see here for details.

share|improve this answer
    
I was just about to mention that. Indeed the server runs of AFS. If that's the case however then shouldn't we worry about security? –  Konos5 Jun 21 '12 at 22:49
    
Not necessarily. It's not like AFS has no permissions system at all. It just happens to have its own system, and mostly ignores the Unix permission bits. See my link for details. –  jjlin Jun 21 '12 at 22:53
1  
Thank you very much for the answer. Much appreciated. –  Konos5 Jun 21 '12 at 22:55

If your home is not on a file system which doesn't respect unix file permissions (like ASF, see this answer), you are most probably root.

Otherwise, you wouldn't be able to write to the myscripts folder even if you were logged in as the owner Konos5. The only exception is the root user who "has always access to everything".

However, as owner you can always change back the access rights and give yourself write access again.

share|improve this answer
    
I am not root. I am using my school's server. –  Konos5 Jun 21 '12 at 22:31
    
Is the folder a symlink? –  speakr Jun 21 '12 at 22:32
    
@speakr ls -l would have shown that, wouldn't it? –  Darth Android Jun 21 '12 at 22:32
    
@DarthAndroid Right, I missed that. –  speakr Jun 21 '12 at 22:36

You will always have access to the folder (of which you are owner) <= that was wrong, it should be "if you are root".

share|improve this answer
    
This is not correct, please see here. –  speakr Jun 21 '12 at 22:30

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.