/go/installssh: installssh from the Command Line

/go/installssh repairs a broken or untrusted SSH setup by replacing it with a clean one. It: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Reinstall SSH and reapply GoAdmio's hardening
/go/installssh

Then check that the service is running and listening:

sshd -t && ss -ltnp | grep sshd

Options

None. Any arguments you pass are written to the log file and otherwise ignored.

Examples

# Run the reinstall
/go/installssh

# Check the service (RHEL family)
systemctl status sshd

# Check the service (Debian and Ubuntu)
systemctl status ssh

# Test the SSH configuration for errors
sshd -t

# Check that the server is listening on port 22
ss -ltnp | grep sshd

# Check the firewall rule (RHEL family)
firewall-cmd --permanent --list-ports
firewall-cmd --list-ports

# Check the firewall rule (Debian and Ubuntu)
ufw status

# Show the fingerprint of the host key now in use
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

# On a client: forget the old host key after the server's keys changed
ssh-keygen -R server.example.com

# Review past runs
tail /var/log/go/installssh.log

Output

The command prints the output of the package manager (dnf or apt), the firewall tool, and finally ssh. It doesn’t print a success message and doesn’t stop on errors: every step runs even if an earlier one failed. The exit status is that of the last command, /go/ssh.

Every run adds a line to /var/log/go/installssh.log:

[Nov 20 14:03:11]# installssh

See the full reference at /go/installssh 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.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *