jk_jailuser(8)

jk_jailuser8

A utility to put an existing user in a jail

Usage

jk_jailuser [OPTIONS] <username> [more usernames]

jk_jailuser --jail=/path/to/jail <username>

Overview

The jk_jailuser utility will change the shell of an existing user <username> to jk_chrootsh and change the home directory to <jail>/./<previous-home-directory>, and it will add the user to <jail>/etc/passwd. On *BSD systems this is <jail>/etc/master.passwd and pwd_mkdb is used to generate the other password files.

The jk_jailuser utility will abort if the <jail>/etc/passwd file is missing, or if the shell is missing in the jail.

If <previous-home-directory> was already inside the jail, a /./ separator is placed on the correct location in the path. If the previous home directory was not in the jail, it is changed. In interactive mode you are asked if you want to move the contents. In non-interactive mode the contents are only moved if the --move option is specified.

Options

-j --jail=jail

The jail directory to use. This jail should exist, and should have at least <jail>/etc/passwd

-v --verbose

Will give verbose output

-h --help

The help screen

-m --move

Move the contents of the home directory inside the jail. If in interactive mode, jk_jailuser will ask if the directory should be moved if that is necessary. In non-interactive mode this option is disabled by default.

-n --noninteractive

No user interaction.

-s --shell=shell

The shell to use inside the jail. Defaults to /usr/sbin/jk_lsh

Releases

Unchanged in 3 releases since Debian 11 (Bullseye).

  1. 11–13

From jailkit 2.23-2+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.