Book Image

CentOS 7 Server Deployment Cookbook

By : Timothy Boronczyk, IRAKLI NADAREISHVILI
Book Image

CentOS 7 Server Deployment Cookbook

By: Timothy Boronczyk, IRAKLI NADAREISHVILI

Overview of this book

CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You’ll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS.
Table of Contents (18 chapters)
CentOS 7 Server Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

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 these steps to specify the default permissions for new files and directories:

  1. To set the mask value globally, open the /etc/profile file:

    vi /etc/profile
    
  2. At the end of the file, add the following directive (adjusting the value as desired). When finished...