Results 1 to 4 of 4

Thread: is it possible to auto-set permissions on any file created in a certain directory?

  1. #1
    Join Date
    Oct 2007
    Beans
    72

    is it possible to auto-set permissions on any file created in a certain directory?

    i am a little familiar with umasks, and how they control default permission on new files. however I need to ensure that all files created in /var/spool/cron have permissions 600. can this be configured? maybe by editing the cron folder in vi?

  2. #2
    Join Date
    Jun 2008
    Location
    Colombia
    Beans
    443

    Re: is it possible to auto-set permissions on any file created in a certain directory

    I don't know if there's you could auto set permissions like you want, but as a workaround, you could set up a cron job to periodically change the permissions of the files in that directory.

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    umask

    Quote Originally Posted by uschxc View Post
    i am a little familiar with umasks, and how they control default permission on new files. however I need to ensure that all files created in /var/spool/cron have permissions 600. can this be configured? maybe by editing the cron folder in vi?
    umasks apply to a particular program, commonly the log in shell. What program will be creating files in /var/spool/cron?

    To get file permissions of 0600, the program creating the files will have to use the umask 0077.

  4. #4
    Join Date
    Sep 2008
    Location
    CyberSpace
    Beans
    240
    Distro
    Kubuntu 22.10 Kinetic Kudu

    Re: is it possible to auto-set permissions on any file created in a certain directory

    Quote Originally Posted by Sarmacid View Post
    I don't know if there's you could auto set permissions like you want, but as a workaround, you could set up a cron job to periodically change the permissions of the files in that directory.
    This is what I do, to make sure the files for Apache are set right.

    On the other note, you are asking if there is a way to make sure any file created in "/var/spool/cron". No there isn't, you just have to make it so that anyone that is going to create a file there has the uMask right.
    I am now back to help the Proton Gaming phase!
    OS: Kubuntu 22.10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •