Setting default permissions for new files and directories

Linux's permissions system governs whether a user can enter a directory or read, write, or execute a file. By setting the permission bits on files and directories, access can be granted or revoked to different users and groups of users. However, it's possible for a user to create a file and expect others in their group to access it, but the initial file permissions prevents this. To help avoid this situation, this recipe teaches you how to set the default permissions for new files and directories by specifying a mask value.

Getting ready

This recipe requires a CentOS system and administrative access, either provided by logging in with the root account or by using sudo.

How to do it...

Follow ...

Get CentOS 7 Server Deployment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.