obdurodon / dh_course

Digital Humanities course site
GNU General Public License v3.0
20 stars 6 forks source link

Setting file permissions recursively #467

Closed mjyb16 closed 3 years ago

mjyb16 commented 4 years ago

I tried setting the file permissions like this: chmod -R g+w /path_to_dir and it told me "permission denied". I tried sudoing, but it said I am not a sudoer.

djbpitt commented 4 years ago

@mjyb16 Apparently group write permission does not also give group members the right to change the permissions of files they do not own themselves. You should be able to change permissions recursively for files that you own, but not for those owned by your teammates. You can delete files owned by your teammates (as long as they are group-writable), but you can’t change their permissions. This is inconvenient.

The simplest solution is probably to set your SFTP umask value to 664 (the default is 644) for regular files and 775 (the default is 755) for directories. How to do that may depend on your local operating system, but if you search for a combination of “sftp” and “umask”, something should turn up.