jk_jailuser(8)
π jk_jailuser β the put-a-real-user-in-jail utility π
okay bestie, so this is jk_jailuser(8) from the jailkit crew, and it's literally the glow-up your existing user needs to get locked in a chroot. no cap.
β¨ NAME β¨
jk_jailuser β a utility to put an existing user in a jail π«Ά
πΈ SYNOPSIS πΈ
jk_jailuser [OPTIONS] <username> [more usernames]
jk_jailuser --jail=/path/to/jail <username>
π DESCRIPTION π
so here's the tea, bestie: jk_jailuser takes an existing user <username> and gives them a whole new life inside a jail. it's giving main character energy, but make it confined. π₯
what it actually does, step by step:
- changes the shell of
<username>tojk_chrootsh - changes the home directory to
<jail>/./<previous-home-directory> - adds the user to
<jail>/etc/passwd - on *BSD systems, that file is
<jail>/etc/master.passwdinstead, andpwd_mkdbis used to generate the other password files π
β οΈ heads up:jk_jailuserwill abort if<jail>/etc/passwdis missing, or if the shell is missing in the jail. no passwd, no vibes. π
now, about that home directory path situation β if <previous-home-directory> was already inside the jail, then a /./ separator is placed on the correct location in the path. cute, right? if the previous home directory was not in the jail, then it gets changed. periodt.
and here's the interactive bit: in interactive mode, you get asked whether you wanna move the contents. in non-interactive mode, the contents are only moved if you pass the --move option. that's it, that's the rule. π
β¨ OPTIONS β¨
-j,--jail=jail β the jail directory to use. this jail should exist, and it should have at least<jail>/etc/passwd(like, minimum effort, bestie π)-v,--verboseβ gives verbose output. she talks. a lot. we love her for it π-h,--helpβ the help screen π§-m,--moveβ move the contents of the home directory inside the jail. if you're in interactive mode,jk_jailuserwill ask if the directory should be moved when that's necessary. in non-interactive mode, this option is disabled by default. π₯-n,--noninteractiveβ no user interaction. silent mode. she doesn't ask, she just does. π-s,--shell=shell β the shell to use inside the jail. defaults to/usr/sbin/jk_lshβ
π SEE ALSO π
your required reading list, bestie β go read all of these:
jailkit(8)jk_check(8)jk_chrootlaunch(8)jk_chrootsh(8)jk_cp(8)jk_init(8)jk_list(8)jk_lsh(8)jk_procmailwrapper(8)jk_socketd(8)jk_uchroot(8)jk_update(8)chroot(2)usermod(8)
π COPYRIGHT π
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Olivier Sessink
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
okay that's the whole thing, you ate it, I'm obsessed. π this was jk_jailuser(8) from the JAILKIT manual, dated 07-02-2010 β go forth and jail responsibly, bestie, and remember: /./ is not a typo, it's a lifestyle. π¦πβ¨
π¦ where this page comes from
- debian bookworm: jailkit 2.23-2 Β· BSD-3-Clause
- debian trixie: jailkit 2.23-2+b1 Β· BSD-3-Clause
- ubuntu jammy: jailkit 2.23-1 Β· BSD-3-Clause
- ubuntu noble: jailkit 2.23-2 Β· BSD-3-Clause
- ubuntu questing: jailkit 2.23-2
- ubuntu resolute: jailkit 2.23-3 Β· BSD-3-Clause
- ubuntu stonking: jailkit 2.23-3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms