FreeBSD Manual Pages
APPJAIL-CMD(1) General Commands Manual APPJAIL-CMD(1) NAME appjail-cmd -- Execute commands in a jail SYNOPSIS appjail cmd all [-e] [-i file] target [args ...] appjail cmd chroot jail [command [args ...]] appjail cmd jaildir [command [args ...]] appjail cmd jexec jail [-l] [[-e name[=value]] ...] [[-U username|-u username]] [-w working-directory] [command [args ...]] appjail cmd local jail [[-j|-r]] [command [args ...]] DESCRIPTION The appjail cmd utility executes commands on a jail or on the host. all is used to run the given command in all existing jails. If -e is specified, appjail cmd exits when the command returns a non-zero exit status. If -i is specified, the content of the file specified by this parameter is used as input for each call of the given command instead of /dev/null. target is any of the subcommands described below. chroot runs the given command in a chroot environment using the jail directory. jaildir is used to execute the given command from the host in the di- rectory where the jails are located. jexec is used to execute the given command in the given jail with, op- tionally, the environment variables set with -e, and in the working di- rectory set by -w, whose default value is /. Use the -l parameter to not run in a clean environment, or in other words, this is the opposite of the -l option specified in jexec(8). For a more detailed descrip- tion of the -U and -u parameters, see jexec(8). If the jail type is a linux+debootstrap jail, the getent(1) command is installed inside the jail and user information has been successfully retrieved using that command, and when the -U flag is set, it uses a modified version of jexec(8) to set the UID and GID (but clearing the supplementary groups) after entering into the jail, so that it works with LinuxJails of that type, since jexec(8) cannot do so due to the difference between the database formats used by the password database functions. local is used to execute the given command from the host. If -j is specified <default> the jail directory is used, but if -r is specified, the root directory of the jail is used. SHELL is used as the command to execute if no command or arguments are specified. EXIT STATUS The appjail cmd utility exits 0 on success, and >0 if an error occurs. It may fail for one of the following reasons: - EX_USAGE: The command was used incorrectly. - EX_NOINPUT: jail cannot be found. - EX_DATAERR: • jail is invalid. • An invalid subcommand was specified. EXAMPLES Example 1: Knowing the default directories used by each subcommand # appjail jail list -j jtest STATUS NAME TYPE VERSION PORTS NETWORK_IP4 UP jtest thin 14.0-RELEASE - - # appjail cmd chroot jtest pwd / # appjail cmd jaildir pwd /usr/local/appjail/jails # appjail cmd jexec jtest pwd /root # appjail cmd local jtest pwd /usr/local/appjail/jails/jtest/jail # appjail cmd local jtest -r pwd /usr/local/appjail/jails/jtest SEE ALSO sh(1) sysexits(3) environ(7) jexec(8) AUTHORS Jess Daniel Colmenares Oviedo <DtxdF@disroot.org> FreeBSD ports 15.quarterly April 3, 2026 APPJAIL-CMD(1)
NAME | SYNOPSIS | DESCRIPTION | EXIT STATUS | EXAMPLES | SEE ALSO | AUTHORS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=appjail-cmd&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>
