Fix Server Upload Permissions
From Web Development
By default, when new files are uploaded, they are only readable by the user that uploaded them. While this is good for security, this means that newly created files will not be available to web site visitors.
The setting that controls this is called the UMASK.
Please be aware, if you change your default permissions to be world viewable and upload a file that should NOT be visible to the world, you will need to manually change the permissions on that file.
Contents |
Optimal UMASK Configurations
If files need to be viewable in a web browser, then the UMASK needs to be changed. There are two recommended UMASK configurations for Mason end users:
-
umask 022- This results in files that are world-readable and only writable by the owner of the files. -
umask 002- This results in files that are world-readable and writable by both the file owner and the group the owner belongs to. This setting is ideal in situations where multiple users need to edit the same files.
Changing the UMASK
Special note: Changing your UMASK permissions will NOT fix permissions on files previously uploaded. You will have to delete the file or folder with incorrect permissions from the webserver and upload again, it will not fix the permissions if you just overwrite the file on the server. It will only fix the permissions of files you upload AFTER you changed your UMASK.
Option 1
- Connect to the Mason Cluster via SSH
- Once you are logged in, enter the following command:
pico .cshrc - This will put you into a text editor. If there is a umask line, edit it so it reads
umask 022orumask 002(See UMASK configurations). Otherwise, simply add the line to the end of the file. - Save the file
(Ctrl+O)(letter O). -
File Name to write: .cshrcwill display towards the bottom of the window. Hit enter. - Exit the file
(Ctrl+X). - Run
pico .profileandpico .loginand repeat Steps 3 and 4. - Log out and then log back in again.
- Type
umaskat themason>prompt. You should seeumask 22orumask 2. If you still seeumask 77then you need to contact the webmaster.
Option 2
Please try the steps outlined in Option 1 above. If this does not work users can email the webmaster and request the change.
