jk_cp(8)

jk_cp8

A utility to copy files including permissions and libraries into a jail

Usage

jk_cp -j jail source

jk_cp -v -k -f -j jail source

Overview

jk_cp will copy any file into a jail on the identical location, with identical permissions and (if required) including any required libraries. It will remove any set user id (setuid) or set group id (setgid) permissions from all files and directories copied.

Examples

jk_cp -j /home/testchroot /usr/bin/cvs

will copy /usr/bin/cvs to /home/testchroot/usr/bin/cvs, and it will copy the libraries used by cvs also to the jail.

jk_cp -k -j /svr/testjail /usr/bin/firefox /usr/share/firefox

will hardlink /usr/bin/firefox and all files in /usr/share/firefox into jail /svr/testjail

Options

-j --jail

The destination jail. If no jail is specified, the first argument is used as jail for backwards compatibility

-f --force

Force overwriting of existing files

-k --hardlink

Try to create hardlinks instead of copying the files. If linking fails it falls back to copying.

-o --owner

Retains the file ownership and group when copying files and directories.

-v --verbose

Will give verbose output

-h --help

The help screen

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.