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> to jk_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.passwd instead, and pwd_mkdb is used to generate the other password files πŸ‘‘
⚠️ heads up: jk_jailuser will abort if <jail>/etc/passwd is 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_jailuser will 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:


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. πŸ¦‹πŸ’–βœ¨