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 permissions644
and directories are created with the permissions755
. Usingg+w
would change file permissions to664
and 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 002
This means that write permissions are removed for everyone else but not for group. In comparison, the default
umask
value 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 = yes
This is a tip from a reply here.
-
Under each individual file share (e.g.,
[shareX]
), add the parameters:directory mode = 775 create mode = 775
Note that you can also do this on Webmin by clicking on the share name, then
File Permissions
, then changeNew Unix file mode
to775
andNew Unix directory mode
to775
(these are masks).
-