Chmod is a great tool for making changes manually, on an occasional basis. If all files created within a particular environment need to have a specific set of permissions, umask is a great utility to automate the permissions assignment.

The standard umask permissions for files and folders created in an environment is 0022, which means that files created will be assigned permissions of 644 (rw-r--r--)

and folders will have 755 (rwxr-xr-x). A more secure umask setting would be 0037.

This forces files to be created with permissions of 640 (rw-r-----) and folders to have

750 (rwxr-x---), creating a situation where confidentiality is assumed and applied by default. For configuration steps and proof-of-concept results, see the following example:

linux:/home/test1/umask folder # umask 0022

linux:/home/test1/umask folder # umask 037 linux:/home/test1/umask folder # umask 0037

linux:/home/test1/umask folder # su test1 [email protected]:/home/test1/umask folder> touch testfile [email protected]:/home/test1/umask folder> ls -l total 0

The umask utility, however, makes changes that can have far-reaching, unforeseen consequences, such as processes on the server no longer functioning at all or as intended. After the desired changes have been made, verify that operations still function on the server as intended.

Additionally, because umask configurations require that an entry be inserted in the shell's rc-file (profile, bash, and so on) to be durable, inspect these locations and modify as needed. If you don't do this, when you reboot the machine, the previous umask configurations will be restored.

Was this article helpful?

0 0
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook

Post a comment