ssh
Rebuild /etc/ssh/sshd_config from GoAdmio's settings (port, root login, shell accounts, chroot), or restart the SSH service
- Command:
/go/ssh - Category: Security
- Required option: None
- Output: None
- Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/ssh writes the SSH server's configuration file, /etc/ssh/sshd_config, from scratch, using the settings stored in GoAdmio, and then restarts the SSH service. This keeps the SSH setup consistent with what you set in GoAdmio:
- the SSH port
- whether
rootmay log in - which hosting accounts get a shell
- hosting accounts without a shell are confined to their own home folder (a chroot)
- root logins allowed from chosen IP addresses only (see
permitrootlogin)
With the restart argument, it only restarts the service.
[!WARNING] The file is rewritten completely every time. Changes you made to
sshd_configby hand are lost, and the new file is not tested before SSH restarts. Keep a second SSH session open while you run it.
Quick start
# Rebuild the configuration and restart SSH
/go/ssh
# Only restart SSH
/go/ssh restart
Syntax
/go/ssh
/go/ssh restart
/go/ssh --serversync
Options
| Argument | Effect |
|---|---|
| (none) | Rebuilds sshd_config and restarts SSH. |
restart |
Restarts SSH without changing the configuration. |
--serversync |
Rebuilds the configuration with much higher connection limits, for moving a server (see serversync). |
The limits that --serversync changes:
| Setting | Normal | With --serversync |
|---|---|---|
MaxSessions |
10 |
250 |
MaxStartups |
10:30:100 |
250 |
MaxAuthTries |
6 |
100 |
ClientAliveInterval |
0 |
60 |
ClientAliveCountMax |
3 |
5 |
Output
The command prints nothing. Every run is logged to /var/log/go/ssh.log with a timestamp and the arguments used.
| Outcome | Exit status |
|---|---|
restart |
0 |
| Rebuild | The status of the final restart. |
The service that is restarted is ssh on Ubuntu and sshd on other systems.
Examples
# Rebuild the configuration
/go/ssh
# Restart only
/go/ssh restart
# Higher limits while migrating a server
/go/ssh --serversync
# Test the configuration without restarting
sshd -t
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| You are locked out after running it | The new configuration is invalid, or the port changed and the firewall doesn't allow it. | Log in through the provider's console. Restore the original file with cp /etc/ssh/sshd_config.bak /etc/ssh/sshd_config, then restart SSH. Next time, test with sshd -t first. |
| Your own SSH settings disappeared | The file is rewritten on every run. | Put the setting in GoAdmio's configuration instead, or edit the script. Files in sshd_config.d/ can't override the settings the command writes, because the main file is read first. |
root can't log in |
The root login setting in GoAdmio is off. | Allow it for specific IP addresses with permitrootlogin. |
| SSH is on a different port than 22 | The port comes from the SSH port setting in GoAdmio. | Check the setting. See port. Open the port in the firewall. |
| A hosting account can't get a shell | Accounts without a shell are chrooted to their home folder. | Enable the shell for the account (see shell and jailedshell). |
| An account with a shell is still chrooted | The exclusion list is built from the account domains, so an account whose username differs from its domain isn't excluded. | Check the Match User line at the end of sshd_config. |
| Many parallel sessions fail during a migration | The normal limits are too low. | Run /go/ssh --serversync, and /go/ssh again afterwards. |
Include /etc/ssh/sshd_config.d/*.conf is missing |
The original file (sshd_config.bak) didn't have it. |
Add it by hand if you need it. |
Details
Backup
The first time the command runs, it copies the existing sshd_config to sshd_config.bak. This is the file from before GoAdmio first rewrote it. It is never replaced afterwards. The command also reads it to decide which optional lines to carry over.
What is written
In this order:
Port <port>, from GoAdmio's SSH port setting (22if it is empty or0)- the five limits shown above
SyslogFacility AUTHPRIVPermitRootLogin yesorno, from GoAdmio's setting (noif the setting is missing)AuthorizedKeysFile .ssh/authorized_keysPasswordAuthentication yes,ChallengeResponseAuthentication no,GSSAPIAuthentication yes,GSSAPICleanupCredentials no,UsePAM yesX11Forwarding yes,PrintMotd no,AcceptEnv LANG LC_*Subsystem sftp internal-sftp- Lines carried over from the original file, if it had them:
Include /etc/ssh/sshd_config.d/*.conf, the AWS LightsailTrustedUserCAKeysline, andCASignatureAlgorithms +ssh-rsa - A
Match Userblock that puts every account exceptroot,go, the GoAdmio SSH user, and the accounts that have a shell into aChrootDirectory %h(their home folder). It is skipped if the GoAdmio SSH user isn't known. - A
Match Group Jailedblock for jailed shell accounts:ChrootDirectory %h, no TCP forwarding, no X11 forwarding. - A
Match Addressblock that allowsPermitRootLogin yesfrom the IP addresses listed withpermitrootlogin, if there are any.
Then it restarts the SSH service.
Files and requirements
| Item | Used for |
|---|---|
/etc/ssh/sshd_config, sshd_config.bak |
The configuration and its first backup. |
/usr/local/goadmio/include/config/config.php |
The GoAdmio SSH user name. |
/var/lib/sqlite/config.db |
The SSH port and the root login setting. |
/var/lib/sqlite/site.db |
The accounts that have a shell. |
/var/lib/sqlite/ssh.db |
The IP addresses allowed to log in as root. |
/var/log/go/ssh.log |
The command log. |
Security notes
- Password logins are always on (
PasswordAuthentication yes), as are X11 forwarding and GSSAPI. The command limits attempts and confines hosting accounts, but it doesn't switch to key-only logins. - Nothing tests the new file before the restart. A broken file stops SSH from starting, and
healwill then run this same command again.
See also
| Command | Description |
|---|---|
port |
Change the default SSH port (22) to another port |
permitrootlogin |
Allow root SSH login from a specific IP |
shell |
Enable or disable SSH shell access for an account |
jailedshell |
Enable or disable a chrooted SSH shell for a domain |
installssh |
Reinstall and enable the OpenSSH server |
sshtop |
Report top SSH brute-force sources and optionally block them |
fail2ban |
Install and configure Fail2ban to ban brute-force sources |
dropbear |
Install Dropbear in GoAdmio |
serversync |
Back up and migrate a GoAdmio server with all configurations |
heal |
Check GoAdmio service status and fix issues |