chroot
run command or interactive shell with special root directory
1. chroot.1.man
Manpage of CHROOT
CHROOT
Section: User Commands (1)Updated: January 2008
Index Return to Main Contents
NAME
chroot - run command or interactive shell with special root directorySYNOPSIS
chroot NEWROOT [COMMAND...]chroot OPTION
DESCRIPTION
Run COMMAND with root directory set to NEWROOT.
- --help
- display this help and exit
- --version
- output version information and exit
If no command is given, run ``${SHELL} -i'' (default: /bin/sh).
AUTHOR
Written by Roland McGrath.REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.COPYRIGHT
Copyright © 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl>This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
chroot(2)The full documentation for chroot is maintained as a Texinfo manual. If the info and chroot programs are properly installed at your site, the command
- info chroot
should give you access to the complete manual.
Index
This document was created by man2html using the manual pages.
Time: 00:20:28 GMT, November 20, 2008
2. chroot.2.man
Manpage of CHROOT
CHROOT
Section: Linux Programmer's Manual (2)Updated: 2004-06-23
Index Return to Main Contents
NAME
chroot - change root directorySYNOPSIS
#include <unistd.h>DESCRIPTION
chroot() changes the root directory to that specified in path. This directory will be used for pathnames beginning with /. The root directory is inherited by all children of the calling process.Only a privileged process (Linux: one with the CAP_SYS_CHROOT capability) may call chroot().
This call changes an ingredient in the pathname resolution process and does nothing else.
This call does not change the current working directory, so that after the call '.' can be outside the tree rooted at '/'. In particular, the superuser can escape from a "chroot jail" by doing:
mkdir foo; chroot foo; cd ..
This call does not close open file descriptors, and such file descriptors may allow access to files outside the chroot tree.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.ERRORS
Depending on the file system, other errors can be returned. The more general errors are listed below:- EACCES
- Search permission is denied on a component of the path prefix. (See also path_resolution(7).)
- EFAULT
- path points outside your accessible address space.
- EIO
- An I/O error occurred.
- ELOOP
- Too many symbolic links were encountered in resolving path.
- ENAMETOOLONG
- path is too long.
- ENOENT
- The file does not exist.
- ENOMEM
- Insufficient kernel memory was available.
- ENOTDIR
- A component of path is not a directory.
- EPERM
- The caller has insufficient privilege.
CONFORMING TO
SVr4, 4.4BSD, SUSv2 (marked LEGACY). This function is not part of POSIX.1-2001.NOTES
A child process created via fork(2) inherits its parent's root directory. The root directory is left unchanged by execve(2).FreeBSD has a stronger jail() system call.
SEE ALSO
chdir(2), path_resolution(7)COLOPHON
This page is part of release 2.78 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.
Index
This document was created by man2html using the manual pages.
Time: 00:20:28 GMT, November 20, 2008
3. chroot.8.man
Manpage of CHROOT
CHROOT
Section: FSF (8)Updated: July 2001
Index Return to Main Contents
NAME
chroot - run command or interactive shell with special root directorySYNOPSIS
chroot NEWROOT [COMMAND...]chroot OPTION
DESCRIPTION
Run COMMAND with root directory set to NEWROOT.
- --help
- display this help and exit
- --version
- output version information and exit
If no command is given, run ``${SHELL} -i'' (default: /bin/sh).
AUTHOR
Written by Roland McGrath.REPORTING BUGS
Report bugs to <bug-sh-utils@gnu.org>.COPYRIGHT
Copyright © 2000 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for chroot is maintained as a Texinfo manual. If the info and chroot programs are properly installed at your site, the command- info chroot
should give you access to the complete manual.
Index
This document was created by man2html using the manual pages.
Time: 00:20:28 GMT, November 20, 2008

