EN · $ USD
Security, DDoS and Backups

Game VDS Security: SSH, RDP and Firewall Settings

7 min read Updated: OyunBulut technical team

In short

Basic security for a game VDS comes down to five steps: use SSH keys instead of passwords on Linux, open RDP only to your own IP and enable account lockout on Windows, open only game ports in the firewall, keep database and development servers off the internet, and block brute-force attempts with fail2ban. DDoS protection does not replace these settings; it complements them.

In this guide
  1. Start with the core principle: as few open doors as possible
  2. Linux VDS: secure SSH with keys
  3. Windows VDS: harden RDP
  4. Never expose development servers to the internet
  5. Restrict management panels and users
  6. What to do after a breach
  7. Does DDoS protection replace a firewall?
  8. Quick checklist
  9. Next step: build on a secure foundation

Every VDS exposed to the internet becomes a target for automated scanners within minutes: password attempts against SSH and RDP, connection attempts on open database ports and bots hunting for known vulnerabilities. The goal of VDS security settings is to stop that traffic at the door. In short: use keys instead of passwords for SSH, open RDP only to your own IP address, leave only game ports open in the firewall, keep development and database services closed to the outside, and block repeated attempts with fail2ban. Below, we walk through each step with commands for Linux and Windows.

Start with the core principle: as few open doors as possible

The only thing a game server needs to expose is the game port players connect to. Management access (SSH, RDP, txAdmin, RCON, panels) is for you only and should ideally be open only to your IP address. Database and development servers should never be exposed to the internet at all.

ServiceDefault portWho should have access?
Minecraft Java25565/TCPEveryone
FiveM30120/TCP and UDPEveryone
txAdmin40120/TCPAdmin IPs only
Rust game / RCON28015/UDP, 28016/TCPGame for everyone, RCON for admins only
SSH22/TCPKey-only, ideally admin IPs only
RDP3389/TCPAdmin IPs only
MySQL / MariaDB3306/TCPNo one (localhost only)

Linux VDS: secure SSH with keys

1. Create an SSH key and add it to the server

On your own computer (this also works in PowerShell on Windows 10/11), generate an Ed25519 key pair:

ssh-keygen -t ed25519 -C "oyun-vds"

Add the public key (the file ending in .pub) to the server. On Linux and macOS:

ssh-copy-id root@SUNUCU_IP

If ssh-copy-id is not available on Windows, add the contents of id_ed25519.pub to the ~/.ssh/authorized_keys file on the server. Then confirm in a new terminal that you can connect without being asked for a password.

2. Disable password login

Once you are sure key login works, set the following lines in /etc/ssh/sshd_config:

PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password
PubkeyAuthentication yes

Watch out: on many distributions, files in the /etc/ssh/sshd_config.d/ folder (for example, ones created by cloud-init) can override settings in the main file. If there is a line containing PasswordAuthentication yes in that folder, change it too. Then test the configuration and reload the service:

sshd -t && systemctl reload ssh

Without closing your current SSH session, try connecting in a new window; if you made a mistake, you can fix it from the session that is still open.

3. Firewall: only the ports you need

On Ubuntu and Debian, use ufw to deny all incoming traffic by default and open only what you need. FiveM example:

apt install -y ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
ufw allow 30120/tcp
ufw allow 30120/udp
ufw allow from YONETICI_IP to any port 40120 proto tcp
ufw --force enable
ufw status verbose

If you run ufw enable without opening the SSH port, you will lock yourself out of the server, so pay attention to the order.

4. Block brute-force attempts with fail2ban

fail2ban is a tool that watches log files and temporarily blocks, via the firewall, IP addresses that make many failed login attempts in a short time.

apt install -y fail2ban

Create the /etc/fail2ban/jail.local file:

[sshd]
enabled  = true
backend  = systemd
maxretry = 5
findtime = 10m
bantime  = 1h
systemctl enable --now fail2ban
fail2ban-client status sshd

When keys are required, password attempts fail anyway; fail2ban keeps those attempts from filling up your logs and consuming resources.

5. Automate updates

apt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades

That way, security patches get applied even if you forget.

Windows VDS: harden RDP

1. Open RDP only to your own IP address

The most effective measure is making RDP reachable only from your IP address. In PowerShell running as Administrator, add a new rule:

New-NetFirewallRule -DisplayName "RDP Yonetici" -Direction Inbound -Protocol TCP -LocalPort 3389 -RemoteAddress YONETICI_IP -Action Allow

After confirming you can connect with this rule, disable the default "Remote Desktop" rules in Windows Firewall. If your home internet IP address changes, remember to update the rule; otherwise you will need console access from the provider's panel.

2. Change the RDP port (optional)

Changing the port does not provide security on its own, but it noticeably reduces the noise from automated scans. First add a firewall rule for the new port, then change the port:

New-NetFirewallRule -DisplayName "RDP 3390" -Direction Inbound -Protocol TCP -LocalPort 3390 -RemoteAddress YONETICI_IP -Action Allow
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber -Value 3390
Restart-Service TermService -Force

When connecting, enter the address as SUNUCU_IP:3390.

3. Account lockout and a strong password

Temporarily lock the account after repeated wrong password attempts:

net accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:30

Network Level Authentication (NLA) should stay enabled, and the Administrator password should be long and unique. Keep Windows Update turned on as well.

4. Open the game ports

New-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow

Never expose development servers to the internet

The most common and most dangerous mistake on game VDSs is running development tools on a publicly accessible port. Tools like Vite, webpack dev server, Node.js debug ports, phpMyAdmin or Jupyter are not designed for production, and automated bots find their vulnerabilities quickly. A hole like this can lead to the whole server being taken over and the tokens and passwords on it being leaked.

  • Bind development servers to 127.0.0.1 instead of 0.0.0.0.
  • If you need remote access, use an SSH tunnel: after running ssh -L 5173:127.0.0.1:5173 root@SUNUCU_IP, open http://localhost:5173 in your own browser.
  • In MariaDB/MySQL, use the bind-address = 127.0.0.1 setting and do not open port 3306 in the firewall.
  • Do NUI or web interface development in a separate environment, not on the live server. See the building a test environment on an hourly VDS guide for how.

Restrict management panels and users

If you use txAdmin, Pterodactyl or a similar web panel, open the panel port only to admin IPs and create a separate account for each admin. A single shared admin password is the first thing people forget to change when someone leaves the team. On Linux, running the game server as a separate user instead of root also limits the impact of a potential script vulnerability:

adduser --disabled-password --gecos "" oyun
chown -R oyun:oyun /opt/oyun-sunucusu
su - oyun

That way, a buggy or malicious plugin cannot reach system files or other services; it can only work inside its own folder.

What to do after a breach

  1. Disconnect the server from the internet or block all incoming traffic in the firewall.
  2. Rotate every secret on the server: Discord bot tokens, database passwords, the FiveM license key, API keys.
  3. From your own computer, replace the SSH keys and passwords registered for this server.
  4. Do a clean install and restore your data from a backup known to be clean. Trying to "clean up" a compromised system is not reliable.

Does DDoS protection replace a firewall?

No. DDoS protection filters high-volume traffic aimed at the server at the network level; password guessing or exploiting an exposed service are low-volume attacks and fall outside that protection. OyunBulut's monthly Intel VDS and Ryzen game VDS plans come with layered DDoS protection, while the settings in this guide protect the inside of the server. Used together, they give you a secure setup. To learn how DDoS protection works, read how game server DDoS protection works.

Quick checklist

  • SSH is key-only, password login is disabled
  • RDP is open only to admin IPs, account lockout is enabled
  • Firewall denies by default, only game ports are open
  • txAdmin, RCON and panels are restricted by IP
  • Database and development servers listen on localhost only
  • fail2ban and automatic security updates are enabled
  • Regular backups stored off the server are in place

Next step: build on a secure foundation

A server that comes with root access, KVM virtualization and layered DDoS protection is the right starting point for applying the settings in this guide. Check out the Intel VDS plans for bots, panels and lightweight game servers, and the AMD Ryzen 9 5900X-based Ryzen game VDS plans for FiveM, Minecraft and Rust servers where single-core performance is critical. If you get stuck during configuration, open a support ticket for help (support is provided in Turkish).

Frequently asked questions

Does changing the SSH port improve security?

Changing the port reduces the noise from automated scans, but it does not provide security on its own. The real protection is disabling password login and using SSH keys only.

How do I change the RDP port on a Windows VDS?

First add a firewall rule for the new port, then change the PortNumber value under the RDP-Tcp key in the registry and restart the TermService service. When connecting, enter the address as IP:port.

What does fail2ban do?

fail2ban watches log files and temporarily blocks, via the firewall, IP addresses that make many failed login attempts in a short time. It reduces brute-force attacks and log clutter.

Do I still need a firewall if I have DDoS protection?

Yes. DDoS protection filters high-volume traffic attacks; for low-volume attacks such as password guessing and exploits against exposed services, you need a firewall and proper access settings.

Should I expose the database port?

No. If the game server and the database are on the same machine, bind MariaDB or MySQL to 127.0.0.1 only and keep port 3306 closed in the firewall.

Is it dangerous to run Vite or a similar development server on a VDS?

Running it on a publicly accessible port is dangerous; these tools are not designed for production, and bots find their vulnerabilities quickly. Bind it to localhost only and access it through an SSH tunnel.

For this guide

Recommended plans

Intel and Ryzen VDS plans with root access, KVM virtualization and layered DDoS protection give you a secure foundation where you can apply the SSH, RDP and firewall settings in this guide with full control.

OB-XEON-1

Recommended

2 GB RAM

$2.95/mo

+VAT

  • Processor2 vCPU
  • ModelIntel Xeon
  • Disk30 GB NVMe
  • LocationIstanbul
  • Port: 1G Port
  • Traffic: Fair use
  • Virtualization: KVM
  • Multi-layer DDoS protection

4 GB RAM

$3.93/mo

+VAT

  • Processor2 vCPU
  • ModelIntel Xeon
  • Disk40 GB NVMe
  • LocationIstanbul
  • Port: 1G Port
  • Traffic: Fair use
  • Virtualization: KVM
  • Multi-layer DDoS protection

6 GB RAM

$4.91/mo

+VAT

  • Processor2 vCPU
  • ModelIntel Xeon
  • Disk50 GB NVMe
  • LocationIstanbul
  • Port: 1G Port
  • Traffic: Fair use
  • Virtualization: KVM
  • Multi-layer DDoS protection

Intel VDS — tüm paketler Ryzen VDS — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.