Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set file creation permissions 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I run Sun Solaris 2.6
I'm trying to set the file creation persmissions to 777 in a particular directory. I read through umask man page but I couldn't figure out how ot do it.

I tried diferent numbers like
umask 555
umask 777
umask 111

but for none of the above I got the file created as " rwx rwx rwx"

Can anybody help me
 
umask command reverses mask ... so for 777 you need umask 000 .... 111 will do 666 and so one ...

Regards,

CA,
>Sun
 
Hi,
By default you can't get the execute permission , even if you set the umask as #umask 000
The maximum permission you can get is -rw-rw-rw-

Suresh.
 
Yep ! 100% correct ....

Files are initially created with permissions of 666 (rw-rw-rw-), directories with permissions of 777, the umask bits are subtracted from these bits to set the final permissions on the file. (Execute permission will never be set when a file is created, it must be explicitly added for files via the chmod
umask resultant permissions (for files)
000 666
011 644
022 644
033 644
044 622
055 622
066 600
077 600
To determine what to set the umask to, subtract the desired permissions from
666 or 777 (e.g. 666 -644 = 022).

Regards,

CA,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top