Jail usage

From wikinotes
Revision as of 16:36, 14 March 2021 by Will (talk | contribs) (→‎jls)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 upgrade; done

jls

jls -s                                      # list all avail jail headers on all jails
jls -h jid name osrelease path | column -t  # print some info