{"id":19569034,"url":"https://github.com/buluma/ansible-role-ssh_chroot_jail","last_synced_at":"2026-04-09T08:38:32.692Z","repository":{"id":40338698,"uuid":"485452627","full_name":"buluma/ansible-role-ssh_chroot_jail","owner":"buluma","description":"Simple SSH chroot jail management.","archived":false,"fork":false,"pushed_at":"2024-07-19T10:29:52.000Z","size":133,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T10:24:30.489Z","etag":null,"topics":["ansible","ansible-role","molecule","ssh","ssh-jail","tox"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/buluma/ssh_chroot_jail","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buluma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"buluma"}},"created_at":"2022-04-25T16:40:12.000Z","updated_at":"2024-07-19T10:29:55.000Z","dependencies_parsed_at":"2023-02-08T12:46:06.318Z","dependency_job_id":"17ec20fc-435c-4ecb-8fdd-6059a2572474","html_url":"https://github.com/buluma/ansible-role-ssh_chroot_jail","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/buluma/ansible-role-ssh_chroot_jail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-ssh_chroot_jail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-ssh_chroot_jail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-ssh_chroot_jail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-ssh_chroot_jail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buluma","download_url":"https://codeload.github.com/buluma/ansible-role-ssh_chroot_jail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-ssh_chroot_jail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260453716,"owners_count":23011572,"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":["ansible","ansible-role","molecule","ssh","ssh-jail","tox"],"created_at":"2024-11-11T06:07:21.293Z","updated_at":"2026-04-09T08:38:32.687Z","avatar_url":"https://github.com/buluma.png","language":"Shell","funding_links":["https://github.com/sponsors/buluma"],"categories":[],"sub_categories":[],"readme":"# [Ansible role ssh_chroot_jail](#ansible-role-ssh_chroot_jail)\n\nSimple SSH chroot jail management.\n\n|GitHub|Issues|Pull Requests|Version|Downloads|\n|------|------|-------------|-------|---------|\n|[![github](https://github.com/buluma/ansible-role-ssh_chroot_jail/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-ssh_chroot_jail/actions/workflows/molecule.yml)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-ssh_chroot_jail.svg)](https://github.com/buluma/ansible-role-ssh_chroot_jail/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-ssh_chroot_jail.svg)](https://github.com/buluma/ansible-role-ssh_chroot_jail/pulls/)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-ssh_chroot_jail.svg)](https://github.com/buluma/ansible-role-ssh_chroot_jail/releases/)|[![Ansible Role](https://img.shields.io/ansible/role/d/buluma/ssh_chroot_jail)](https://galaxy.ansible.com/ui/standalone/roles/buluma/ssh_chroot_jail/documentation)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/buluma/ansible-role-ssh_chroot_jail/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n\n  vars:\n    ssh_chroot_l2chroot_path: /usr/bin/l2chroot\n    ssh_chroot_jail_users:\n      - name: foo\n        home: /home/foo\n        shell: /bin/bash\n\n  roles:\n    - role: buluma.ssh_chroot_jail\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/buluma/ansible-role-ssh_chroot_jail/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: yes\n  gather_facts: no\n\n  roles:\n    - role: buluma.bootstrap\n```\n\nAlso see a [full explanation and example](https://buluma.github.io/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/buluma/ansible-role-ssh_chroot_jail/blob/master/defaults/main.yml):\n\n```yaml\n---\nssh_chroot_jail_path: /var/jail\n\nssh_chroot_jail_group_name: ssh_jailed\n\nssh_chroot_jail_users: []\nssh_chroot_jail_dirs:\n  - bin\n  - dev\n  - etc\n  - lib\n  - lib64\n  - usr/bin\n  - usr/lib\n  - usr/lib64\n  - home\n\n# can include type: c, b, p\n# c = char device (unbuffered) [the default]\n# b = block device (buffered)\n# p = FIFO device\n# anything else may result in errors with mknod or systemd-tmpfiles\nssh_chroot_jail_devs:\n  - { dev: \"null\", major: \"1\", minor: \"3\" }\n  - { dev: \"random\", major: \"5\", minor: \"0\" }\n  - { dev: \"urandom\", major: \"1\", minor: \"5\" }\n  - { dev: \"zero\", major: \"1\", minor: \"8\" }\n\nssh_chroot_tmpfiles_conf_path: /etc/tmpfiles.d/ssh-chroot.conf\n\nssh_chroot_bins:\n  - /bin/cp\n  - /bin/sh\n  - /bin/bash\n  - /bin/ls\n  - /bin/rm\n  - /bin/cat\n  - /bin/grep\n  - /bin/sed\n  - /bin/chmod\n  - /bin/chown\n  - /bin/ed\n  - /bin/nano\n  - /usr/bin/tail\n  - /usr/bin/head\n  - /usr/bin/awk\n  - /usr/bin/wc\n  - /usr/bin/sort\n  - /usr/bin/uniq\n  - /usr/bin/cut\n  - /usr/bin/scp\n  - /usr/bin/tee\n  - /usr/bin/touch\n  - /usr/bin/vim\n  - /usr/bin/vi\n  - /usr/bin/dircolors\n  - /usr/bin/tput\n  - /usr/bin/free\n  - /usr/bin/top\n  - /usr/bin/find\n  - bin: /usr/bin/which\n    l2chroot: false\n  - /usr/bin/id\n  - /usr/bin/whoami\n  - /usr/bin/groups\n  # Can also set mode, e.g. to setuid or set different permissions.\n  # - bin: /bin/ping\n  #   mode: 4755\n\nssh_chroot_l2chroot_template: l2chroot.j2\nssh_chroot_l2chroot_path: /usr/local/bin/l2chroot\n\nssh_chroot_copy_extra_items:\n  - /etc/hosts\n  - /etc/passwd\n  - /etc/group\n  - /etc/ld.so.cache\n  - /etc/ld.so.conf\n  - /etc/nsswitch.conf\n\nssh_chroot_sshd_chroot_jail_config: |\n  Match group {{ ssh_chroot_jail_group_name }}\n      ChrootDirectory {{ ssh_chroot_jail_path }}\n      X11Forwarding no\n      AllowTcpForwarding no\n\nssh_chroot_jail_dirs_recurse: true\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/buluma/ansible-role-ssh_chroot_jail/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub |\n|-------------|--------|\n|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Build Status GitHub](https://github.com/buluma/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions)|\n\n## [Context](#context)\n\nThis role is part of many compatible roles. Have a look at [the documentation of these roles](https://buluma.github.io/) for further information.\n\nHere is an overview of related roles:\n\n![dependencies](https://raw.githubusercontent.com/buluma/ansible-role-ssh_chroot_jail/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/robertdebock):\n\n|container|tags|\n|---------|----|\n|[Debian](https://hub.docker.com/r/robertdebock/debian)|all|\n|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|all|\n\nThe minimum version of Ansible required is 2.12, tests have been done on:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them on [GitHub](https://github.com/buluma/ansible-role-ssh_chroot_jail/issues).\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/buluma/ansible-role-ssh_chroot_jail/blob/master/LICENSE).\n\n## [Author Information](#author-information)\n\n[buluma](https://buluma.github.io/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuluma%2Fansible-role-ssh_chroot_jail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuluma%2Fansible-role-ssh_chroot_jail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuluma%2Fansible-role-ssh_chroot_jail/lists"}