roj (run on jail) runs a command (login shell by default) on a local or remote jail
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.