Book Image

Mastering Linux Security and Hardening

By : Donald A. Tevault
Book Image

Mastering Linux Security and Hardening

By: Donald A. Tevault

Overview of this book

This book has extensive coverage of techniques that will help prevent attackers from breaching your system, by building a much more secure Linux environment. You will learn various security techniques such as SSH hardening, network service detection, setting up firewalls, encrypting file systems, protecting user accounts, authentication processes, and so on. Moving forward, you will also develop hands-on skills with advanced Linux permissions, access control, special modes, and more. Lastly, this book will also cover best practices and troubleshooting techniques to get your work done efficiently. By the end of this book, you will be confident in delivering a system that will be much harder to compromise.
Table of Contents (15 chapters)
Title Page
Packt Upsell
Contributors
Preface

Encrypting directories with eCryptfs


Encrypting entire partitions is cool, but you might, at times, just need to encrypt an individual directory. For that, we can use eCryptfs. We'll need to use our Ubuntu machines for this, because Red Hat and CentOS no longer include eCryptfs in version 7 of their products. (It was in Red Hat 6 and CentOS 6, but it's no longer even available for installation in version 7.)

Home directory and disk encryption during Ubuntu installation

When you install Ubuntu Server, you have two chances to implement encryption. You'll first be given the chance to encrypt your home directory:

Later, on the Partition disks screen, you'll be given the chance to set up encrypted logical volumes for whole disk encryption:

After choosing this option, you will then be asked to enter a passphrase:

The disk encryption uses LUKS, just the same as we saw on the CentOS machine. To prove this, all we have to do is look for a populated crypttab file in the /etc directory:

donnie@ubuntu3:~...