Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F116030576
D40831.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40831.diff
View Options
diff --git a/usr.sbin/jexec/jexec.8 b/usr.sbin/jexec/jexec.8
--- a/usr.sbin/jexec/jexec.8
+++ b/usr.sbin/jexec/jexec.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 24, 2016
+.Dd October 7, 2023
.Dt JEXEC 8
.Os
.Sh NAME
@@ -65,6 +65,44 @@
.Ar command
should run.
.El
+.Sh EXAMPLES
+.Ss Example 1 : Open a shell in a jail
+The following command specifies a jail by its name and utilizes the current
+user's shell:
+.Pp
+.Dl # jexec name
+.Pp
+It is also possible to specify a jail by its jid:
+.Pp
+.Dl # jexec JID
+.Ss Example 2 : Run a single command without opening a shell
+The following command runs
+.Ql uname -a
+in a jail called
+.Dq name .
+Since a command is specified explicitly,
+.Nm
+does not spawn an interactive shell.
+Instead,
+.Nm
+executes the specified command directly.
+.Pp
+.Dl # jexec name uname -a
+.Ss Example 3 : Open a shell in a jail with a clean environment
+The following command opens a
+.Xr sh 1
+shell in a jail with a clean environment:
+.Pp
+.Dl # jexec -l name sh
+.Ss Example 4 : Open a shell in a jail with the login command
+The following command utilizes
+.Xr login 1
+to access the jail, submitting an audit record, and displaying the
+user's last login, system copyright, and
+.Xr motd 5
+message:
+.Pp
+.Dl # jexec -l name login -f root
.Sh SEE ALSO
.Xr jail_attach 2 ,
.Xr jail 8 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 8:17 PM (11 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17911741
Default Alt Text
D40831.diff (1 KB)
Attached To
Mode
D40831: jexec man: Add examples section
Attached
Detach File
Event Timeline
Log In to Comment