Linux: Set permission only to directories [closed]

chmod can actually do this itself; the X symbolic permission means “execute, if it makes sense” which generally means on directories but not files. So, you can use: chmod -R u=rwX,go=rX /path/to/htdocs The only potential problem is that if any of the plain files already have execute set, chmod assumes it’s intentional and keeps it. … Read more

What is the normal chmod?

Here’s a summary that I have gathered: Usage: chmod <number> <filename> chmod all files to 644 chmod all .htaccess files to 644 chmod all robots.txt files to 644 chmod all directories to 711 chmod all directories with directory listing (.htaccess Options +Indexes) to 755 chmod all directories that users can upload files to, to 755 … Read more

preserving file permissions for samba shares when file is edited

Could finally figure out why permission was changing. The confusion arose from the map archive = yes setting being the default value in Samba. After setting map archive = no, the owner execute bit started behaving like I expected it to behave. Found the answer by reading the documentation over here: http://www.samba.org/samba/docs/using_samba/ch08.html in the File … Read more