The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
To run a command in a chroot jail in an existing directory
(chroot_jail
), use the following
command:
# chroot chroot_jail
command
If you do not specify a command argument,
chroot runs the value of the
SHELL
environment variable or
/bin/sh
if SHELL
is not
set.
For example, to run /bin/bash in a chroot jail (having previously set it up as described in Section 3.13.2, “Creating a Chroot Jail”):
#chroot /home/oracle/jail
bash-4.1#pwd
/ bash-4.1#ls
bash: ls: command not found bash-4.1#exit
exit #
You can run built-in shell commands such as pwd in this shell, but not other commands unless you have copied their binaries and any required shared libraries to the chroot jail.
For more information, see the chroot(1)
manual page.