/go/jailedshell gives an account an SSH shell that is confined to its own home folder (a chroot jail). Inside the jail the user sees /home/<domain> as /, and can only run a handful of commands. It: The restriction is enforced by the SSH server. It works only if the configuration written by ssh contains the chroot rule for the Jailed group. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Enable the jailed shell
/go/jailedshell example.com
# Disable it
/go/jailedshell example.com --disable
Arguments
| Argument | Required | Default | Notes |
|---|---|---|---|
<domain> |
Yes | — | The account’s primary domain, as stored in GoAdmio. It is not checked. |
0 or --disable |
No | Enable | Disables the jailed shell. |
Examples
# Enable for one account
/go/jailedshell example.com
# Disable
/go/jailedshell example.com --disable
# Check the group and the jail
getent group Jailed
ls /home/example.com/bin
Output
The command prints no messages of its own. You see the output of the programs it runs:
| Output | Meaning |
|---|---|
groupadd: group 'Jailed' already exists |
Harmless. The group is created again on every run. |
Removing user <name> from group Jailed |
Printed when disabling. |
cp: ... errors |
A library or program could not be copied. |
The output of ssh |
The SSH configuration was rewritten. |
The exit code is the one returned by ssh.
Logging
Every run is appended to /var/log/go/jailedshell.log.
See the full reference at /go/jailedshell and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
