Enabling SSH Access on Lightspeed Hosting Linux Servers
By default, SSH access is disabled on Linux servers deployed on Lightspeed Hosting for security reasons.
Before enabling SSH, follow these steps to secure your server and allow safe access.
Step 1: Configure the Firewall in the Client Area
Before enabling SSH, it's essential to configure your firewall to allow access only from trusted sources (e.g., your office IP).
-
Log in to your Client Area.
-
Navigate to Additional Tools > Firewall.
-
Under the Firewall tab, click Create Firewall Rule and configure the following:
- Enable: Set to On to activate the rule.
- Type: Select In (inbound traffic).
- Action: Choose Accept to allow SSH traffic.
- Interface: Set to net0 (public interface).
- Macro: (Optional) Use predefined settings for common services.
- Source: Enter your office’s public IP address to restrict SSH access.
- Destination: Leave as default (your server's IP).
- Protocol: Choose TCP.
- Source Port: Leave blank (not needed for SSH).
- Destination Port: Enter 22 (SSH port).
- Comment: (Optional) Add a description, e.g., "Allow SSH from Office."
-
Save the rule and enable the firewall under Firewall Options.
Step 2: Create a New User for SSH Access
For security reasons, avoid logging in as root. Instead, create a new user with sudo privileges:
Follow the prompts to set a password.
Then, grant sudo privileges:
Step 3: Enable SSH Authentication
SSH authentication can be configured in two ways:
- (Recommended) SSH Key Authentication – More secure and preferred over passwords.
- Password Authentication – Less secure but can be enabled if necessary.
Option 1: Enable SSH Key Authentication (Recommended)
To set up SSH key authentication, generate an SSH key and copy it to the server using:
(Setting up SSH keys is outside the scope of this article.)
Option 2: Enable SSH Password Authentication
If you prefer password authentication, modify the SSH configuration file:
Find the line:
Change it to:
Save and exit by pressing Ctrl + X, then Y, and Enter.
Restart the SSH service for changes to take effect:
Step 4: Test SSH Access
Try logging in from your local machine:
If successful, SSH is now enabled!
Final Security Recommendations:
✅ Disable root login via SSH by setting PermitRootLogin no
in /etc/ssh/sshd_config
.
✅ Use fail2ban to block repeated failed login attempts: