GoAdmio

shell

Enable or disable regular (non-jailed) SSH shell access for a hosted account; enabling also removes the account's chroot jail

On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · Security · See also


Overview

/go/shell controls whether a hosting account can log in over SSH with a normal shell. It can:

The command changes the account's Shell flag in GoAdmio's database, then runs ssh to rewrite the SSH server configuration so the change is applied.

[!WARNING] Running the command without an action enables shell access. Only 0 or --disable turns it off. Any other value, or nothing, turns it on.

For a restricted shell that keeps the account inside its own folder, use jailedshell instead.


Quick start

# Enable shell access for a domain's account
/go/shell example.com

# Disable it
/go/shell example.com 0

Syntax

/go/shell <domain> [0 | --disable]

The command writes the call and a timestamp to /var/log/go/shell.log. Run it as root, because one step does not use sudo.


Arguments

Position Argument Required Notes
1 <domain> Yes The hosted domain, written the same way as in GoAdmio. The account's username is looked up from it.
2 0 or --disable No Disables shell access.
You pass Result
example.com Enables shell access.
example.com 1 Enables shell access.
example.com anything-else Enables shell access.
example.com 0 Disables shell access.
example.com --disable Disables shell access.
--disable example.com Does not work. The domain must be the first argument, so --disable is read as the domain and no account is changed.

The command does not check that the domain exists. A misspelled domain changes nothing and prints no error.


Output

There is no success message. The only output comes from the tools the command runs:

Check the result by trying an SSH login, or by looking at the account's shell setting in GoAdmio.


Examples

# Give an account a regular SSH shell
/go/shell example.com
# Remove shell access
/go/shell example.com --disable
# Review recent calls
tail /var/log/go/shell.log

Troubleshooting

Symptom Likely cause Fix
Nothing changes and no error is shown The domain is misspelled or not hosted, so no account matched. Use the domain exactly as GoAdmio shows it.
gpasswd complains about a missing user or wrong arguments The domain has no account, so the username was empty. Check the domain name.
user '<name>' is not a member of 'Jailed' The account had no jailed shell. Nothing to fix. The command continues.
group 'Jailed' does not exist No jailed shell has been set up on this server. Nothing to fix. The command continues.
gpasswd: Permission denied The command was not run as root. Run it as root.
The account's jailed shell was turned off Enabling shell access removes the jail. Use jailedshell to enable the jail again.
The account is still connected after disabling Sessions that are already open are not ended. End them, for example with pkill -u <username>.

Details

What it does

  1. Records the call in the log.
  2. Looks up the account's username from the Site table in /var/lib/sqlite/site.db.
  3. If the second argument is 0, or --disable appears anywhere in the arguments, it disables:
    • sets Shell=0 for the domain
  4. Otherwise it enables:
    1. If the domain contains a dot, deletes bin, lib, and lib64 inside /home/<domain>. These are the folders of the chroot jail.
    2. Removes the user from the Jailed group with gpasswd -d.
    3. Sets Shell=1 and JailedShell=0 for the domain.
  5. Runs ssh to rewrite /etc/ssh/sshd_config.
flowchart TD
    A["shell domain [action]"] --> B["Log the call, look up username"]
    B --> C{"Action is 0 or --disable?"}
    C -- "Yes" --> D["Shell = 0"]
    C -- "No" --> E["Delete jail folders bin, lib, lib64"]
    E --> F["Remove user from Jailed group"]
    F --> G["Shell = 1, JailedShell = 0"]
    D --> H["Run ssh to rewrite SSH configuration"]
    G --> H

Enable and disable compared

Enable Disable
Shell flag Set to 1 Set to 0
JailedShell flag Set to 0 Not changed
Jail folders (bin, lib, lib64) Deleted Not changed
Jailed group User removed Not changed
SSH configuration Rewritten Rewritten
Open SSH sessions Not affected Not ended

The SSH configuration is rewritten on every run, even when nothing else changed.


Security


See also

Command Description
jailedshell Enable or disable a chrooted SSH shell for a domain
ssh Rewrite /etc/ssh/sshd_config with GoAdmio hardening
sshtop Report the top SSH brute-force sources and optionally block them
port Change the default SSH port (22) to another port
password Change a GoAdmio account's FTP, SSH, and panel login password
create Create a GoAdmio account (--shell and --jailedshell options)