Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Set file Permissions on Linux and ACL

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

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer