{"id":25188576,"url":"https://github.com/kleinpanic/chroot_manager","last_synced_at":"2025-09-13T01:07:26.710Z","repository":{"id":275680377,"uuid":"926849526","full_name":"kleinpanic/chroot_manager","owner":"kleinpanic","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-22T03:01:49.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T04:17:48.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kleinpanic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-04T00:47:03.000Z","updated_at":"2025-02-22T03:01:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"aab24754-0a7d-4764-ab1d-b45e8036cf6e","html_url":"https://github.com/kleinpanic/chroot_manager","commit_stats":null,"previous_names":["kleinpanic/chroot_manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinpanic%2Fchroot_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinpanic%2Fchroot_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinpanic%2Fchroot_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinpanic%2Fchroot_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kleinpanic","download_url":"https://codeload.github.com/kleinpanic/chroot_manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157280,"owners_count":20893221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-09T20:29:12.779Z","updated_at":"2025-04-04T10:14:22.447Z","avatar_url":"https://github.com/kleinpanic.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chroot_manager\n\n**chroot_manager** is a fully featured tool for managing chroot environments on Debian‐based systems. It provides a simple command-line interface for creating, connecting to, disconnecting from, and monitoring a chroot jail. The tool supports daemon mode—using `strace`—to log all system calls made within the chroot environment, along with installation and uninstallation support for easy deployment.\n\n## Features\n\n- **Create** a minimal Debian chroot jail using `debootstrap`.\n- **Connect** to the chroot, automatically mounting necessary filesystems (e.g., `/dev`, `/proc`, `/sys`, `/tmp`).\n- **Daemon mode:** With the `--daemon` flag, run the chroot session under `strace` so that all system calls (and those of forked child processes) are logged to separate files.\n- **Disconnect** from the chroot and unmount all bind mounts.\n- **Status** command to display the current mount status for the chroot jail.\n- **Verbose/debug mode** for detailed logging.\n- **Install/Uninstall:** Easily install the tool (and its man page and bash completions) to system directories.\n- **Extensible:** Designed to be further enhanced with configuration file support, advanced logging, and additional completions.\n\n## Requirements\n\n- A Debian-based system.\n- Root privileges are required for creating, connecting, disconnecting, and installing/uninstalling the tool.\n- Required commands: `debootstrap`, `chroot`, `mount`, `xhost`, `xauth`, `sudo`, and `strace`.\n\n## Installation\n\nTo install **chroot_manager** system-wide, run:\n\n```bash\nsudo ./chroot_manager.sh install [--verbose]\n```\n\nThis command will:\n- Copy the script to `/usr/local/bin/chroot_manager` and set the executable permission.\n- Install the man page (if `chroot_manager.1` exists in the current directory) to `/usr/local/share/man/man1` and compress it.\n- Install the bash completion file (if `chroot_manager.bash_completion` exists) to `/etc/bash_completion.d/chroot_manager`.\n\n## Uninstallation\n\nTo remove **chroot_manager** and its associated files, run:\n\n```bash\nsudo ./chroot_manager.sh uninstall [--verbose]\n```\n\nThis command removes:\n- The binary from `/usr/local/bin/chroot_manager`.\n- The man page from `/usr/local/share/man/man1/chroot_manager.1.gz`.\n- The bash completion file from `/etc/bash_completion.d/chroot_manager`.\n\n## Usage\n\n**Basic Syntax:**\n\n```bash\nsudo chroot_manager [--verbose] [--daemon] \u003ccommand\u003e\n```\n\n**Commands:**\n\n- **create**  \n  Create the chroot jail using debootstrap.  \n  Example:\n  ```bash\n  sudo chroot_manager create\n  ```\n\n- **connect**  \n  Mount necessary filesystems, set up X access, and enter the chroot environment.  \n  With `--daemon`, the session is traced via `strace`, and system calls are logged to files in the daemon log directory (default: `$(pwd)/chroot_daemon_logs`).  \n  Example:\n  ```bash\n  sudo chroot_manager --daemon connect\n  ```\n\n- **disconnect**  \n  Unmount the bind mounts from the chroot and revoke X server permissions.  \n  Example:\n  ```bash\n  sudo chroot_manager disconnect\n  ```\n\n- **status**  \n  Display the current mount status for the chroot jail.  \n  Example:\n  ```bash\n  sudo chroot_manager status\n  ```\n\n- **help**  \n  Display a detailed help message with usage and command descriptions.  \n  Example:\n  ```bash\n  sudo chroot_manager help\n  ```\n\n- **install**  \n  Install the tool to `/usr/local/bin` along with its man page and bash completion.  \n  Example:\n  ```bash\n  sudo chroot_manager install\n  ```\n\n- **uninstall**  \n  Remove the installed tool and its associated files.  \n  Example:\n  ```bash\n  sudo chroot_manager uninstall\n  ```\n\n## Configuration\n\nBy default, **chroot_manager** assumes:\n- The chroot jail is located at `/var/chroot`.\n- The Debian mirror used is `http://deb.debian.org/debian`.\n- Daemon logs (when in daemon mode) are stored in a directory in the current working directory named `chroot_daemon_logs`.\n\nFeel free to modify these defaults directly in the script or extend the tool with configuration file support in future versions.\n\n## Bash Completion\n\nIf installed, bash completions will allow you to auto-complete the available commands and options when using **chroot_manager** in your shell.\n\n## License\n\nThis project is released under the terms of the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions, suggestions, and bug reports are welcome! Please submit issues and pull requests via GitHub.\n\n## Author\n\n*Kleinpanic*  \n*kleinpanic@gmail.com*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleinpanic%2Fchroot_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkleinpanic%2Fchroot_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleinpanic%2Fchroot_manager/lists"}