chroot(ADM)


chroot -- change root directory for command

Syntax

chroot newroot command

Description

The given command is executed relative to the new root. The meaning of any initial slashes (/) in pathnames is changed for a command and any of its children to newroot. In addition, the initial working directory is newroot.

Notice that ``chroot newroot command > x'' creates the file x relative to the original root, not the new one.

This command is restricted to the super user.

The new root pathname is always relative to the current root even if a chroot is currently in effect. The newroot argument is relative to the current root of the running process. Note that it is not possible to change directories to what was formerly the parent of the new root directory; that is, the chroot command supports the new root as an absolute root for the duration of the command. This means that ``/..'' is always equivalent to ``/''.

Diagnostics

command must be under newroot or ``command: not found'' is reported.

Warning

Exercise extreme caution when referencing special files in the new root file system.

See also

cd(C), chdir(S-osr5)

Standards conformance

chroot is conformant with:

AT&T SVID Issue 2;
X/Open Portability Guide, Issue 3, 1990: note that the X/Open CAE Specification, Commands and Utilities, Issue 4, 1992 marks this command as withdrawn.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005