Instructions for setting group-writable permissions
Last Updated 2019-05-31 by Adam Lu
Individual Files
-
To change a file’s permission to group writable, use one of the following:
# Change a directory or file that you created to be group writable chmod g+w [fileOrDirPath] # Change a directory or file that someone else created to be group writable sudo chmod g+w [fileOrDirPath] # Change a directory you created and all files within it to be group writable chmod -R g+w [dirPath] # Change a directory someone else created and all files within it to be group writable sudo chmod -R g+w [dirPath] # An alias Adam made for all users on fishfish chmodRgw [fileOrDirPath]Caution: It is not advisable to change permission recursively to
775, because that would make a lot of files erroneously executable. By default, files are created with the permissions644and directories are created with the permissions755. Usingg+wwould change file permissions to664and directory permissions to775, respectively, as desired.
Global settings
-
For Unix in general, add this line to either the file
~/.bashrc(to set this for yourself only) or the file/etc/bash.bashrc(to set this for all users on the machine):umask 002This means that write permissions are removed for everyone else but not for group. In comparison, the default
umaskvalue is022, which would remove write permissions for both group and everyone else. -
For Samba, edit the Samba configuration file
/etc/samba/smb.conf:-
Under
[global](the Global settings section), add this parameterinherit permissions = yesThis is a tip from a reply here.
-
Under each individual file share (e.g.,
[shareX]), add the parameters:directory mode = 775 create mode = 775Note that you can also do this on Webmin by clicking on the share name, then
File Permissions, then changeNew Unix file modeto775andNew Unix directory modeto775(these are masks).
-