Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just got hold of a Linux machine running Ubuntu from my friend. It places 644 permission on all new files created by a user.

But for some purposes I want 755 permission on all files and folder created by that user, I have been searching on Internet from all day long but did not got hold of any useful resources plus I am a beginner to Linux system as well.

share|improve this question

1 Answer 1

In the .profile of that user or in the global /etc/profile, put

umask 027

Note to self: to get the umask, subtract the desired directory octal permissions from 777, so in that case 777-750 becomes 027. This should give drwxr-x---.

With that umask, the file creation mask will be 666-027 = 640 (note that this is not real subtraction, you subtract digit by digit); this will give -rw-r-----.

In short: you can read, write and change into directories; group can read and change into directories; anyone else is blocked. Is that correct?

share|improve this answer
1  
it does not help, I already tried this. It makes permission to be this -----w--w- –  Abhi Sep 18 '12 at 14:04
    
Silly me, forgot to subtract the chmod value from 777. –  January Sep 18 '12 at 14:49
    
I also just figured out the same, but is it not possible to have both directory and files a 755 permission. As far as I got, with umask files never get an execute permission. –  Abhi Sep 18 '12 at 14:58
    
Ah, now I understand your question properly. Sorry, you are right, I don't think that's possible. –  January Sep 18 '12 at 15:01

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.