Linux – Set server ACL folders 755 and files 644 permissions

access-control-listlinuxUbuntuweb-server

In /var/www, I want all folders (recursively) to have the permissions of 755. I want all files to have the permission of 644. I want all new files and folders to take on these permissions as well.

I've been looking at many examples but I feel like I'm never going to figure this out. Any help would be appreciated.

Best Answer

chmod -R a-rwX /dir
chmod -R u=rwX,g=rX,o=rX /dir