How to Create a Chroot Jail Directory and Configure Users to Use it.

(Doc ID 2411858.1)

Last updated on JUNE 21, 2018

Applies to:

Linux OS - Version Oracle Linux 5.0 and later
Linux x86
Linux x86-64

Goal

The goal of this document is to provide a step by step guide on not only how to create and configure your chroot jail directory but also guide you on how to set up your users to use said jail directory.

It also explains a common solution to the below errors that can occur:

Error when trying to ssh with your jailed user:

# ssh user@server
user@server's password:
Write failed: Broken pipe

/var/log/secure displaying below error:

Jun 15 12:00:00 server sshd[6504]: fatal: bad ownership or modes for chroot directory component "/your_directory/"

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms