Launch pricingNo GST added. What you see is what you pay.

Secure your server · 10 min

Secure your server in the first 10 minutes

Update the system, create a normal user and turn off password logins for root.

A new server is reachable from the whole internet, and automated bots start trying to log in within minutes. These steps close the most common doors. They're written for Ubuntu and Debian.

1. Update everything

bash
apt update && apt upgrade -y

2. Turn on automatic security updates

bash
apt install -y unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades

3. Create a normal user

Working as root all the time is risky. Create your own user and give it admin rights (replace deploy with any name):

bash
adduser deploy
usermod -aG sudo deploy

Copy your SSH key to the new user so you can sign in as them:

bash
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy

4. Turn off password logins

Once key login works, stop SSH from accepting passwords and root logins:

bash
sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i 's/^#\?PermitRootLogin .*/PermitRootLogin no/' /etc/ssh/sshd_config
systemctl restart ssh

From now on, sign in as your user and use sudo for admin commands.

5. Allow only what you need

Turn on the Rack'Em firewall and allow just SSH and the ports your apps use. See Set up the firewall.

Locked yourself out?

The web console works without SSH, so you can always get back in and undo a change.

Stuck? Contact us or open a support ticket from your panel.