[CoD2] Setting Up a Call of Duty 2 Server on Ubuntu
List of Chapters
Step 1: Secure Your Server
Step 2: Install the Call of Duty 2 Server Prerequisites
Step 3: Installing CoD2
Step 4 (Optional): Installing libcod Prerequisites
Step 5 (Optional): Compiling libcod from Source
Step 6: Starting Your CoD2 Server
Step 7 (Optional): Starting CoD2 with libcod
Step 8: Creating Your Own Mod
Step 9: Protecting Your Server Against DDoS Amplification Attacks
Step 10: Build Something Awesome
Copyright Notice
First, you’ll need a server running a minimal Ubuntu x64 installation. This guide should work without any modifications on Ubuntu 20.04 and newer.
Other Linux distributions may work as well. Debian is very similar to Ubuntu, so most of the steps described here should also apply there. CentOS, however, differs significantly, meaning many of the steps will need to be adapted accordingly.
For example, you can rent a VPS (Virtual Private Server) from a provider such as VibeGAMES.
Step 1: Secure Your Server
The very first step for any server that is accessible over the Internet should always be securing it.
The most common attack vector against publicly accessible servers is brute-force attacks targeting SSH root access. Therefore, it is highly recommended to disable both password authentication over SSH and direct root login. (informations here)
In practice, this means following a guide to set up SSH key authentication (public/private key). Be sure to select the correct Ubuntu version, as many guides default to Ubuntu 14.04. (guid here)
If security is a top priority, you should generate your SSH key pair on your local computer rather than on the server itself. On Windows, PuTTYgen is a popular tool for this purpose.
Change the SSH Port
The next step in securing your SSH access is changing the default SSH port.
By default, every SSH server listens on port 22. Since this is common knowledge, port scanners and brute-force attacks will always target this port first.
To change the SSH port, edit the following file:
/etc/ssh/sshd_config
Locate the following line:
Port 22
Change it to another port. A port above 1024 but below 65536 is recommended. The author of this guide, for example, uses a port between 30000 and 40000.
After making the change, restart the SSH service:
sudo service ssh restart
Afterwards, reconnect to your server using your SSH client and the new port.
Configure a Firewall (example here)
Next, you should configure a firewall to provide an additional layer of protection for your server.
Important: If you changed your SSH port, you must also allow that port through your firewall. Otherwise, you may accidentally lock yourself out of your server.
