简体   繁体   中英

bash housekeeing script needed permission to delete different folders and files in folder

we are going to create a housekeeping script in eg PARENT_FOLDER. In PARENT_FOLDER there will be many different folders and files with different owners.

Please let me know what would be the proper permission solution for this scenarion. I assume the better is to set +wx on PARENT_FOLDER, but I'd like to ensure this is the only option as security is the most important thing for me.

Thanks, Alex

Make sure to assign the correct permission to the folder that you are going to manage. If you will only bye the administrator of the directory PARENT_FOLDER then you should assign the permission (rwx-rxrx). (chmod 775 PARENT_FOLDER) Then with the sub-directories you have to assign the permissions you want for each user and add the folder to each user with chown -user -directory. So in this way every user will have only access to edit their own files in his directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM