GoAdmio Command Line: port with /go/port

SSH listens on port 22 by default, and attackers try that port first. Moving SSH to another port cuts down on automatic login attempts. /go/port does this in one command. It: To go back to the standard port, run /go/port 22. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Move SSH to port 2222
/go/port 2222

# Then, from a second terminal, test it before you close the first
ssh -p 2222 root@your-server

Arguments

Position Argument Required Notes
1 <port> Yes The new SSH port. Use a free port number above 1024, for example 2222. Use 22 to go back to the standard port.

The port is not validated. Always pass a number from 1 to 65535. With no argument, or with text, an invalid Port line is written and SSH may not start again.

If another program already listens on the port, the command prints Port <port> in use. and stops with status 1. Port 22 is always accepted.

Examples

# Move SSH to port 2222
/go/port 2222

# Check which port SSH is listening on
sudo ss -tlnp | grep sshd

# Log in on the new port
ssh -p 2222 root@your-server

# Go back to the standard port
/go/port 22

# Close the old port in the firewall, once the new one works
/go/deny 22

Output

OpenSSH Manager has been changed successfully.

This line is printed even if the SSH server did not restart. Check the result with:

sudo ss -tlnp | grep sshd

If the port is already in use:

Port 2222 in use.

See the full reference at /go/port 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 *