Skip to main content
SaltStack Support

Setting file and directory permissions

To set directory and file permissions in a state file you can use the file module in the state file. 

Here is an example of setting directory and files permissions recursively. This SLS file will set the permissions on the data directory and all of the sub-directories and files: 

    - dir_mode: 755
    - file_mode: 666
      - recurse:
      - mode

For more information visit:

  • Was this article helpful?