By editor, 3 July, 2016 Question How to set file and folder Permissions on Linux ? How to use ACL to automatically change default file and directories permissions ? Using chmod, chown chgrp Change File / Directories permissions. chmod 0777 . -R # chmod g+s /var/www # chmod +x *.sh # Change File / Folder Owner. chown www-data:www-data -R . Change File / Directories Group. chgrp www-data . -R Using ACL Note : Install the alc package if not already installed Set file / Folder permissions 1. Add ACL optin to the /etc/fstab mount moints /dev/yourrootmapper / ext4 errors=remount-ro,acl 0 1 2. Re Mount mount -oremount / 3.1 Set custom permission to the directory you want sudo setfacl -dm u::rwx,g::rwx,o::r /var/www 3.2 Set custom group permission sudo setfacl -m "default:group::rwx" /var/www 3.3 Set default gruop sudo setfacl -Rdm g:apache:rx /var/www Set Default User/permission (NOT TESTED) sudo setfacl -d -m default:user:the_name:rwx sudo setfacl -d -m default:group:the_name:rwx 4. Get ACL Permissions list getfacl /my/folder Tags Server Shell Linux Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments