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

Confining sessions to a chroot jail


This recipe teaches you how to set up a chroot jail. A chroot call changes the user's view of the filesystem hierarchy by setting a particular path as the root; for the user, the path appears as / and they are unable to traverse beyond it. This creates a sandbox or jail, confining the user to a small branch of the real hierarchy. Chroot jails are commonly used for security purposes, for example, user containment and honeypots and also for application testing and in recovery procedures.

Getting ready

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

How to do it...

Follow these steps to configure a chroot jail and confine users to it:

  1. Download the cpchroot script needed to copy commands and their dependencies into the chroot environment:

    curl -Lo ~/cpchroot tinyurl.com/zyzozdp
    
  2. Make the script executable using chmod:

    chmod +x ~/cpchroot...