Skip to content

codehz/nsroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nsROOT

┌┐┌┌─┐╦═╗╔═╗╔═╗╔╦╗
│││└─┐╠╦╝║ ║║ ║ ║ 
┘└┘└─┘╩╚═╚═╝╚═╝ ╩ 

chroot, mount --bind without privilege

Installation

Options:

  1. Use github release asset (x86_64, built with musl-gcc)
  2. Compile from source
    • Prerequisites
      • git
      • cmake
      • make or ninja
    • Steps
      git clone https://github.com/CodeHz/nsroot.git
      cd nsroot
      mkdir build && cd build
      cmake .. && cmake --build . && sudo cmake --build . --target install

Usage

nsroot [-x] [-X] [-p] [-f] [-r root] [-b dir[:target]] [-t target[:options]] [-c target] [-w workdir] /path/to/program [...args]
  • -x
    Setup user & mount namespace.
  • -X
    Setup mount namespace.
  • -p
    Mount proc filesystem.
  • -f
    Fork before exec.
  • -r path
    Use path as the new guest root file-system, default is /.
  • -b path
    Make the content of path accessible in the guest rootfs.
  • -t path
    Create tmpfs on path in guest rootfs.
  • -c path
    Create folder structure in guest rootfs.
  • -w path
    Set the initial working directory to path.
  • -a appname
    Set the initial process name.