

Minecraft Java Edition server 1.18.2 requires Java 17. Install the Temurin 17 OpenJDK Distribution

Update the system, and then reboot: # apt updateĪfter the server instance gets up and running again, log in as the newly created sudo user mcninja for the following tasks. Setup UFW firewall rules to allow only traffic on SSH (22) and the default Minecraft (25565) ports: # ufw default denyĬommand may disrupt existing ssh connections. # echo 'mcninja ALL=(ALL) NOPASSWD: ALL' | tee -a /etc/sudoers.d/designated # echo 'mcninja:sud04QeXbcx#6&Cw' | chpasswd & history -d -1 # echo '/swap none swap defaults 0 0' | tee -a /etc/fstabĬhange the initial root password to a private and strong one, such as r00tyHvM%2ka$8E3: # echo 'root:r00tyHvM%2ka$8E3' | chpasswd & history -d -1Ĭreate a non-root user account with sudo privileges, such as mcninja, and then also set up a strong password for it, such as sud04QeXbcx#6&Cw: # useradd -ms /bin/bash mcninja Otherwise, set up a swap file of 2GB to smooth system operations: # fallocate -l 2g /swap

Open your favorite SSH client on your desktop machine, such as PuTTY on Windows, and then log in to your server instance as root with the initial password you found on the Server Details page.Īfter logging in, execute the following tasks to harden the system.įind out if any swap file or swap partition is in use: # swapon -s

This article uses 203.0.113.100 as an example IP address.
