Shell & Commands
Use jails console for an interactive root login shell, or jails exec to run a command directly and return to your host shell.
Both commands must run as root on the Sylve node, with the target Jail already running. They do not require a Sylve configuration file or a running Sylve daemon, and are unavailable inside sylve --console.
Open a Jail shell
Section titled “Open a Jail shell”Open a local interactive shell:
doas sylve jails console --ctid 101This command resolves the running Jail with jls, then opens root’s login shell through jexec and su -l root.
Leave the Jail shell with:
exitExiting the shell does not stop the Jail.
Run a command without opening a shell
Section titled “Run a command without opening a shell”Use jails exec to run a command:
doas sylve jails exec --ctid 101 -- uname -aThe command runs as root inside the Jail with a clean environment. It does not start a login shell, read shell startup files, or allocate a pseudo-terminal. Standard input, standard output, and standard error are inherited, and the command’s exit status and signals are preserved.
Everything after -- is passed directly as command arguments, including flags such as --help. Sylve does not interpret shell syntax; explicitly invoke a shell for pipelines, redirections, or multiple commands inside the Jail:
doas sylve jails exec --ctid 101 -- /bin/sh -c 'id && uname -a'cat script.sh | doas sylve jails exec --ctid 101 -- /bin/shQuote shell expressions so your host shell does not expand them first. Supplying no command is an error, not a request for an interactive shell. To use a program outside the clean environment’s search path, supply its full path inside the Jail.