Table of Contents

Name

chrootuser - run a command chrooted as given user

Synopsis

chrootuser user dir command [options]

Description

This tool executes a given command chrooted like chroot(8) . Unlike chroot you must specify an user account to switch to after chrooting. Mapping of user name to user id will be done before chroot() call.
As a special case the capabilities CAP_SYS_CHROOT and CAP_SYS_MODULE will be removed if a user with UID 0 will be specified. To support this your kernel must be >= 2.6.25. But don’t rely on proper removing the capabilities. Don’t start any black or evil software with this. A chroot environment is not a jail. You have been warned.

Return Value

The return value is 1 if forking failed otherwise 0.

Examples

chrootuser nobody /usr/chroot php -i

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents