Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for iocage instead of jexec #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ This means any commands executed by sshjail roughly translate to `sudo jexec $ja
An alternative to requiring root access is to use the [`jailme`](http://www.freshports.org/sysutils/jailme) utility.
`jailme` is "a setuid version of jexec to allow normal users access to FreeBSD jails".

If you want to use `jailme`, you'll need to ensure it's installed on the jailhost, and specify the user to `sudo` as
Another alternavite to requering root acces is to use the [`iocage`](https://www.freshports.org/sysutils/iocage/) utility.
`iocage` is a "jail/container manager amalgamating some of the bestfeatures and technologies the FreeBSD operating system has to offer"

If you want to use `jailme` or `iocage`, you'll need to ensure it's installed on the jailhost, and specify the user to `sudo` as
via `--become-user` on the command line, or `become_user: username` in a play or task. sshjail will prefer to use `jailme`
if it's installed, whether you are sudoing as root or not.
Comment on lines +82 to 87
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor spelling/formatting suggestions:

Suggested change
Another alternavite to requering root acces is to use the [`iocage`](https://www.freshports.org/sysutils/iocage/) utility.
`iocage` is a "jail/container manager amalgamating some of the bestfeatures and technologies the FreeBSD operating system has to offer"
If you want to use `jailme` or `iocage`, you'll need to ensure it's installed on the jailhost, and specify the user to `sudo` as
via `--become-user` on the command line, or `become_user: username` in a play or task. sshjail will prefer to use `jailme`
if it's installed, whether you are sudoing as root or not.
Another alternative to requiring root access is to use the [`iocage`](https://www.freshports.org/sysutils/iocage/) utility.
`iocage` is a "jail/container manager amalgamating some of the best features and technologies the FreeBSD operating system has to offer"
If you want to use `jailme` or `iocage`, you'll need to ensure it's installed on the jailhost, and specify the user to `sudo` as
via `--become-user` on the command line, or `become_user: username` in a play or task.
sshjail will prefer to use `iocage`, then `jailme` if they are installed, whether you are sudoing as root or not.


Expand Down
4 changes: 4 additions & 0 deletions sshjail.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ def get_jail_id(self):

def get_jail_connector(self):
if self.connector is None:
code, _, _ = self._jailhost_command("which -s iocage")
if code == 0:
self.connector = 'iocage'
return self.connector
code, _, _ = self._jailhost_command("which -s jailme")
if code != 0:
self.connector = 'jexec'
Expand Down