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

Running binaries as a different user


Every program on CentOS runs within the environment of a user account regardless of whether the program is executed by a user or run as an automated system process. However, sometimes we want the program to run with different restrictions and access those rights the account is allowed. For example, a user should be able to use the passwd command to reset their password. The command needs write access to /etc/passwd but we don't want the user running the command to have such access. This recipe teaches you how setting a program's SUID and SGID permission bits allows it to execute within the environment of a different user.

Getting ready

This recipe requires a CentOS system. Administrative privileges are also required, either by logging in with the root account or by the use of sudo.

How to do it...

Follow these steps to allow a program to execute as a different user:

  1. Identify the file's owner and group details using the ls command. The third field in its output...