*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: jexec | Section: 8 | Source: FreeBSD | File: jexec.8.gz
JEXEC(8) FreeBSD System Manager's Manual JEXEC(8) NAME jexec - execute a command inside an existing jail SYNOPSIS jexec [-l] [-d working-directory] [-u username | -U username] jail [command ...] DESCRIPTION The jexec utility executes command inside the jail identified by its jid or name. If command is not specified then the user's shell is used. The following options are available: -d working-directory The working directory for running commands inside the jail. The default is the jail root directory. -l Execute in a clean environment. The environment is discarded except for HOME, SHELL, TERM, USER, and anything from the login class capability database for the user. PATH is set to "/bin:/usr/bin". If a user is specified (via -u or -U), and absent the -d option, commands are run from that (possibly jailed) user's directory. -u username The user name from host environment as whom the command should run. This is the default. -U username The user name from jailed environment as whom the command should run. EXAMPLES Example 1: Open a shell in a jail The following command specifies a jail by its name and utilizes the current user's shell: # jexec name It is also possible to specify a jail by its jid: # jexec JID Example 2: Run a single command without opening a shell The following command runs `uname -a' in a jail called "name". Since a command is specified explicitly, jexec does not spawn an interactive shell. Instead, jexec executes the specified command directly. # jexec name uname -a Example 3: Open a shell in a jail with a clean environment The following command opens a sh(1) shell in a jail with a clean environment: # jexec -l name sh Example 4: Open a shell in a jail with the login command The following command utilizes login(1) to access the jail, submitting an audit record, and displaying the user's last login, system copyright, and motd(5) message: # jexec -l name login -f root SEE ALSO jail_attach(2), jail(8), jls(8) HISTORY The jexec utility was added in FreeBSD 5.1. BUGS If the jail is not identified by jid there is a possible race in between the lookup of the jail and executing the command inside the jail. Giving a jid has a similar race as another process can stop the jail and start another one after the user looked up the jid. FreeBSD 14.1-RELEASE-p8 March 5, 2025 FreeBSD 14.1-RELEASE-p8

Navigation Options