permissions - chown for files generated by a process running as root

06
2014-04
  • Andy Le

    I have a Fedora server running an application as root (via sudo). The users operating the application can extract data with "Save as" menu from inside the application. However, the generated files has the owner "root", group "root" and permission 600. So the users then need to contact admin to claim their files. Any suggestion to make it simpler?

    I thought of adding chown to sudoers so users can chown files on their Desktop, but what if they create a hard link on Desktop pointing to other places?

    Thank you.

  • Answers
  • andrej

    Take a look at sticky bit on the directory: http://www.thegeekstuff.com/2011/02/sticky-bit-on-directory-file/ and set the group on the target directory.


  • Related Question

    fedora - Making files created by a cronjob readable by apache
  • Beaming Mel-Bin

    A software package I installed on my Fedora box has an associated cronjob. This cronjob creates html files that need to be readable by apache. At the moment, the files are not readable because they are owned by the application's user (not apache) and not world readable.

    How should I proceed in fixing this? I begun going down the path of modifying the script to either chmod or chown the html files but I've paused those efforts figuring the SU community might think of a more elegant way.


  • Related Answers
  • Dennis Williamson

    Your script can set the file creation mask to allow world readability using umask:

    umask 0022
    

    will cause any subsequently created files to be readable by group and other (rw-r--r--).