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 ...
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.