Optimal UMASK Configurations
If files need to be viewable in a web browser, then the user file-creation mode mask (UMASK) needs to be changed. The two recommended UMASK configurations for Mason end-users are:
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.
Note: Ensure that you set up the UMASK permissions BEFORE you upload the files into your folder.
How to Change the UMASK
IMPORTANT: Changing your UMASK permissions will NOT fix permissions on files previously uploaded or if you just overwrite the file on the server. It will only fix the permissions of files you upload AFTER you changed your UMASK. In order to change the UMASK permissions on folders or folders, you will need to:
- Change UMASK permissions.
- Delete the file or folder with incorrect permissions from the web server.
- Upload the files again.
Login using your credentials.
You should now be in your home drive, you can confirm this by typing
pwd and selecting enter. Your current directory will be displayed. It should say /
home/userid. If you are not in your home drive, please navigate to your home drive before continuing with the commands below. Enter
cd /home/youruserid, replacing youruserid with your user ID (usually your NetID) and select Enter.
Once you are logged in, and after you are done with setting up your web folder (public_html), enter the following command:
This will put you into a text editor. If there is a UMASK line, edit it so it reads
umask 022 or
umask 002 (See UMASK configurations). Otherwise, simply add the line to the end of the file. Refer to the screenshot below.
Save the file
(Ctrl+O) (letter O).
File Name to write: .cshrc will display towards the bottom of the window. select Enter.
Exit the file
pico .profile and
pico .login and repeat Steps 4 and 5.
Log out of the session by entering the command
mason> logout, then log back in again.
Note: This step is REQUIRED to see the change. You must log out of all connections to the web server, including Dreamweaver.
umask at the
mason> prompt. If you have successfully set up the permissions, you should see
umask 22 or
umask 2 at the
mason> prompt. If you still see
umask 77 then you need to contact the webmaster.
Note: While entering these commands into the mason prompt, if you happen to make any typing enters, you can use the Delete button instead of Backspace button.
If this does not work and you have followed all the steps above, email the webmaster and describe which step was unsuccessful. If you are trying to fix permissions on your personal website (i.e., mason.gmu.edu/~userID) please refer to how to create a web folder on a personal site.
- This permission error normally occurs when a file on the server is not world-readable. 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.
- This issue also appears when you happen to set all permissions correctly but do not upload the
index.htmlfile in your
public_htmlfolder. Please see how to upload files for further details.
Sometimes you won’t see a umask line in either of the
pico .login or
pico .profile files. In such cases, just insert umask 022 or umask 002 at the position of the cursor shown in the screenshot and then continue from Step 4.