cancel
Showing results for 
Search instead for 
Did you mean: 

UMASK

Former Member
0 Kudos

Hi Experts,

I would like to know that is there any way to set UMASK only for one selected directory? UMASK settings are global, but I would like to set UMASK to XYZ folder to be 007. only that folder so if Everyone user were to put a file in XYZ folder, they will rw-rw permission.

Is it possible?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Juan,

My directory has 777. when I touch a file, It creates with RW-RR from UMASK 022.

Thanks,

Former Member
0 Kudos

Hi there,

you can set an umask to an folder????? Thats new for me, and i think not possible.

You can chmod the rights of an folder.

Or you can change the "umask" for an specific user.

So the umask is usercontextspecific. It is possible to

set the umask only for a loginsession,

or permanent. If umask set permanent, all files created under this user,

will have these filerights.

edit

Your Problem can be solved with "setfacl" and "getfacl", say Access Control Lists.

There you can tell the Folder, which default rights a file gets, if it will be created there.

Regards

Manuel

Edited by: Manuel Herr on May 14, 2008 8:43 AM

Answers (3)

Answers (3)

former_member699105
Participant
0 Kudos

Using Linux filesystem ACLs, you can set a Default mask for a directory. Properly constructed, it will affect files created in the directory.

This mechanism is totally separate from the umask value in your shell environment. Don't confuse or conflate the two.

You should read and understand man acl and man setfacl - experiment somewhere that it won't hurt anything and make sure you have designed the proper solution.

Former Member
0 Kudos

Hi Juan,

Yes, you are right. But that is only for time being. If I go to that directory and umask it to 007, it will change to umask and If i touch a file, it creates a file according umask 007. but that is only for one time. If i logout or someone else try to touch a file again, it takes the default umask and it is global. I want to keep the umask for global as it is but I would like to change the umask of XYZ folder to be 007 permanently.

Thanks,

JPReyes
Active Contributor
0 Kudos

I think what you are looking for is chmod, to change the permisions on a diretory permanently use command chmod xxx <pahth> (xxx meaning the specific permission switches, example 777 or 755).

Regards

Juan

JPReyes
Active Contributor
0 Kudos

As far as i know you can umask a specific directory by just using command umask 007 /<path>/<directory> or by going to the directory and executing the command on it own... correct me if im wrong.

Regards

Juan