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.


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?

  • 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

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.