Skip to content
/ roj Public

roj (run on jail) runs a given command (a login shell by default) on a local or remote jail

License

Notifications You must be signed in to change notification settings

astralblue/roj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roj (Run On Jail)

roj is a simple command-line tool that runs a command (login shell by default) in the given jail, either locally or over SSH.

Examples:

roj abc

Runs a login shell in the local jail named abc.

roj -H adx ldap1 ps axl

Runs ps axl in the jail named ldap1 on the remote SSH host adx.

roj

Shows the jails on the local host.

roj -H pbsp

Shows the jails on the remote SSH host pbsp.

iocage Compatibility

The iocage jail manager uses the ioc- prefix in its jail names. To maintain compatibility with iocage, by default roj shows and accepts jail names without the ioc- prefix.

Except if there is a conflict, then this prefix stripping behavior is disabled. For example, if there is a jail ioc-xyz and there is also another jail xyz, then the former is shown as and must be specified as ioc-test.

This behaviour can be disabled using the -f/--full flag.

SSH Host (-H/--host) Config

The hostname given to -H/--host is provided verbatim to OpenSSH ssh(1) so the name is subject to the usual configuration settings. For example, to use a shorthand alias, ex: roj -Hadx:

Host adx
        HostName adx-florence.bop.gov

SSH Pseudo TTY Allocation

Just like OpenSSH ssh(1), by default login shells are run with a pseudo TTY, and explicit commands are run without one. This behavior can be overridden with --tty/--no-tty (or -t/-T, as with ssh(1)).

Bash Completion

To use Bash completion support of roj:

complete -C 'roj --bash-complete' roj

It takes connection-related options (-H/--host and -u/--user) so the following works as expected:

alias roj1='roj --host=server1'
complete -C `roj1 --bash-complete` roj1

About

roj (run on jail) runs a given command (a login shell by default) on a local or remote jail

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages