GoGetSpace Engineering Last tested 7 min readTested onUbuntu 24.04AlmaLinux 9Fedora 45
Short answer
On a new GoGetSpace Linux server, do 5 things: install updates, turn on automatic security updates, turn on a firewall that keeps SSH open, add swap if your plan has 1 or 2 GB of memory (Fedora already has it), and set your time zone. Then restart once. You don't need to create a user or change SSH: you already log in as a normal user with sudo, and SSH accepts keys only.
permitrootlogin without-password
passwordauthentication no
passwordauthentication no means SSH never asks for a password. On Fedora the names are in mixed case and root shows prohibit-password. It means the same thing.
The root user has no key of its own. If you try to log in as root, the server only replies with a message:
Bash
$ ssh root@your-server-ip
Output
Please login as the user "ubuntu" rather than the user "root".
Step 1: Install updates
Our images are fresh, but updates come out every week. Install them before anything else:
Bash
$ sudoapt update &&sudoapt upgrade -y
On Ubuntu 24.04 you may see Pending kernel upgrade! and a list of services being restarted. That's normal, and you stay connected. If a full-screen question asks which services to restart, press Enter. If it asks about a changed configuration file, keep the version that's already installed.
Bash
$ sudodnf upgrade -y
This takes 2 to 4 minutes. Many updates, such as a new kernel, only take effect after a restart. You'll restart once at the end, in Step 6.
Step 2: Turn on automatic security updates
New security holes are found all the time. Automatic updates install the fixes every day, so you don't have to remember. They don't move your software to a new major version.
On Ubuntu this is already on, and these commands only confirm it. On Debian they turn it on.
NEXT LEFT LAST PASSED UNIT ACTIVATES
Sat 2026-12-05 06:54:43 UTC 6h - - dnf5-automatic.timer dnf5-automatic.service
Automatic updates don't restart your server. After a kernel update, restart it yourself at a quiet time.
Step 3: Turn on a firewall
A firewall blocks every port you haven't opened, so a program that listens by mistake can't be reached from the internet. There's no firewall in front of your server at the moment, so this one is yours to turn on.
Bash
$ sudoapt install -y ufw
$ sudoufw allow OpenSSH
Output
Rules updated
Rules updated (v6)
Only go on if you see Rules updated. Then turn UFW on:
Bash
$ sudoufw enable
It asks Command may disrupt existing ssh connections. Proceed with operation (y|n)?. Type y and press Enter. Your SSH rule is already in place, so you stay connected. Check:
Bash
$ sudoufw status
Output
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Before you go on, open a new terminal window and connect to your server again. If it connects, SSH is allowed. If it doesn't, turn the firewall off in your first window (sudo ufw disable or sudo systemctl stop firewalld) and check the SSH rule.
When you set up a website later, open the web ports with sudo ufw allow 80,443/tcp. More in Set up a firewall with UFW.
On Fedora the list is dhcpv6-client mdns ssh. Either way, ssh is in it.
Before you go on, open a new terminal window and connect to your server again. If it connects, SSH is allowed. If it doesn't, turn the firewall off in your first window (sudo ufw disable or sudo systemctl stop firewalld) and check the SSH rule.
When you set up a website later, open the web ports:
Swap is disk space the server uses when memory runs out. Without it, Linux stops programs, such as your database, to free memory. On plans with 4 GB or more you can skip this step.
Fedora already has about 1 GB of swap in compressed memory (zram), so skip this step on Fedora. On the other systems, check that there's no swap yet:
Bash
$ swapon --show
Only go on if it prints nothing. Then add a 1 GB swap file (use 2G on the 2 GB plan):
The last line keeps the swap after a restart. Check it:
Bash
$ free -h
Output
total used free shared buff/cache available
Mem: 961Mi 269Mi 563Mi 1.0Mi 271Mi 691Mi
Swap: 1.0Gi 0B 1.0Gi
The Swap row now shows 1.0Gi. Your Mem numbers will be different.
Step 5: Set your time zone
Your server starts on UTC. Logs and scheduled jobs (cron) use the server's time zone, so set the one you work in. For Malaysia:
Bash
$ sudo timedatectl set-timezone Asia/Kuala_Lumpur
Check it:
Bash
$ timedatectl |grep'Time zone'
Output
Time zone: Asia/Kuala_Lumpur (+08, +0800)
To find another zone's name, run timedatectl list-timezones | grep -i followed by your city, for example timedatectl list-timezones | grep -i london.
Step 6: Restart once
Restart now, so the new kernel, the updates and the new time zone are all in use:
Bash
$ sudo reboot
Your SSH session closes. Wait about 30 seconds and connect again. Your firewall and swap are still on after the restart.
Later, after updates, you can check if a restart is needed:
Bash
$ cat /var/run/reboot-required
Output
*** System restart required ***
If it says cat: /var/run/reboot-required: No such file or directory, you don't need to restart. This check is for Ubuntu. On Debian, restart after a kernel update.
Bash
$ sudodnf needs-restarting -r
Output
Core libraries or services have been updated since boot-up:
* kernel
Reboot is required to fully utilize these updates.
On Fedora the list is longer. The line that matters is Reboot is required. If it says Reboot should not be necessary., you don't need to restart.
If you lock yourself out
1
Open your server's page and start the browser console. It works even when SSH or the firewall is broken.
2
Click One-time password. It takes up to a minute to be ready. Then sign in as your login user (for example ubuntu) with it.
No. The login user on our servers (for example ubuntu) is already a normal user with sudo, and root can't log in over SSH. Add more users only if other people need their own login.
Do I need fail2ban?
Not for SSH. Our servers accept SSH keys only, so login attempts can't guess their way in. fail2ban mainly cuts down the failed attempts in your logs. It can still help protect other services, such as a website login.
Should I change the SSH port?
It isn't needed, and we don't recommend it. A different port only reduces noise in the logs. Changing it safely takes extra steps on most systems, and a mistake locks you out.
Will automatic updates restart my server?
No. They install fixes but don't restart. Some fixes, such as a new kernel, only take effect after you restart, so restart now and then at a quiet time.
Does the firewall protect my Docker containers?
Not by default. Docker adds its own rules, so ports you publish with Docker can be reached from the internet. Publish private containers on 127.0.0.1 only, for example -p 127.0.0.1:8080:80.
Do you back up my server?
Not at the moment. Keep copies of your important files and databases somewhere else, for example on your computer or another storage service.
Was this helpful?
Bash
$ sudoapt install -y ufw
$ sudoufw allow OpenSSH
Output
Rules updated
Rules updated (v6)
Only go on if you see Rules updated. Then turn UFW on:
Bash
$ sudoufw enable
It asks Command may disrupt existing ssh connections. Proceed with operation (y|n)?. Type y and press Enter. Your SSH rule is already in place, so you stay connected. Check:
Bash
$ sudoufw status
Output
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Before you go on, open a new terminal window and connect to your server again. If it connects, SSH is allowed. If it doesn't, turn the firewall off in your first window (sudo ufw disable or sudo systemctl stop firewalld) and check the SSH rule.
When you set up a website later, open the web ports with sudo ufw allow 80,443/tcp. More in Set up a firewall with UFW.
On Fedora the list is dhcpv6-client mdns ssh. Either way, ssh is in it.
Before you go on, open a new terminal window and connect to your server again. If it connects, SSH is allowed. If it doesn't, turn the firewall off in your first window (sudo ufw disable or sudo systemctl stop firewalld) and check the SSH rule.
When you set up a website later, open the web ports: