Jail usage: Difference between revisions
From wikinotes
(→jls) |
(→Basics) |
||
Line 11: | Line 11: | ||
jexec ${jail} -u will <command> # run command as user in jail | jexec ${jail} -u will <command> # run command as user in jail | ||
for jid in $(jls | tail +2 | awk '{ print $1 }'); do yes | sudo pkg -j $jid upgrade; done | for jid in $(jls | tail +2 | awk '{ print $1 }'); do yes | sudo pkg -j $jid -y upgrade; done | ||
</source> | </source> | ||
</blockquote><!-- Basics --> | </blockquote><!-- Basics --> |
Revision as of 18:58, 16 April 2022
Basics
# basics jls # list all jails jexec ${jail} # enter jail service jail start ${jail} # start jail jexec ${jail} <command> # run command in jail jexec ${jail} -u will <command> # run command as user in jail for jid in $(jls | tail +2 | awk '{ print $1 }'); do yes | sudo pkg -j $jid -y upgrade; done
jls
jls -s # list all avail jail headers on all jails jls -h jid name osrelease path | column -t # print some info