Linux: Set permission only to directories

后端 未结 6 1847
盖世英雄少女心
盖世英雄少女心 2021-01-30 07:07

I have to change the permissions of the htdocs directory in apache to a certain group and with certain read/write/execute.

The directories need to have 775

6条回答
  •  爱一瞬间的悲伤
    2021-01-30 07:56

    Gordon's answer above is correct, but if you're trying to lock down access to a directory tree, it leaves scripts that are executable to the owner also executable to whoever has been granted the capital X.

    Using

    find  -type d -exec chmod 775 {} +
    

    or

    find  -type d -exec chmod 755 {} +
    

    is safer.

提交回复
热议问题