umask usage

Hi ,

i am facing small issue if anybody help appreciated.
how can we give the default permissions as 777 for files by using umask command..

advance thank you..

regards
rajesh:wall:

umask can force a bit off, but it can't force a bit on. umask 0 allows all of the bits that a programmer cares to set. You cannot force all files to 777.

hi perderabo,

thank you for your reply.

can you explain the proper reason for that?

thank you.
regards
rajesh

That's just the way it works. Unix commands were setting too many bits and it was not very secure because of it. umask was conceived as a way to tighten security. You're trying to loosen security... not much demand for that.

'umask' is a subtractive value, so files and directories are evaluated differently.

umask 000; touch filename.txt

will have a octal value of 666 and,

umask 000; mkdir new_directory

will have an octal value of 777

You cannot set a 'umask' for files = '777'

In other words, all files does not require the execute permission. which is the final 1 in the 7.

But the directories require, with which you can navigate to that directory.