Skip to Content
avatar image
Former Member

UMASK

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,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    May 13, 2008 at 08:13 PM

    Hi Juan,

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

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • May 13, 2008 at 07:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 13, 2008 at 07:59 PM

    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,

    Add comment
    10|10000 characters needed characters exceeded

    • 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