UnrealIRCd and Atheme IRC Services

Last modified date

This guide was made using Debian Operating System.


Tools needed:


Step #1 – Operative System

Connect and login with PuTTY using SSL and preform this command:

sudo apt update

Step #2 – Security – Firewall

We’ll use UFW (Uncomplicated Firewall) with limited ports and rate limiting to help prevent brute-force attacks.

sudo apt install ufw -y
sudo ufw allow 22/tcp comment "SSH" && sudo ufw limit 22
sudo ufw allow 6667/tcp comment "IRCd-plain" && sudo ufw limit 6667
sudo ufw allow 6697/tcp comment "IRCd-secure" && sudo ufw limit 6697
sudo ufw allow 6900/tcp comment "IRCd-link" && sudo ufw limit 6900

sudo ufw enable
Statussudo ufw status verbose
Show Addedsudo ufw show added
Disablesudo ufw disable

Step #3 – Unreal IRC daemon

Recommend to setup your SSL-certificate with Let’s Encrypt

https://www.unrealircd.org/docs/Installing_from_source

Step #1: Prerequisites

sudo apt-get install build-essential pkg-config gdb libssl-dev libpcre2-dev libargon2-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev

Step #2: Create a new user (For security reasons, do not install services as the root user.)

sudo adduser unrealircd
su - unrealircd

Step #3: Download

wget --trust-server-names https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz
tar xzvf unrealircd-6.2.6.tar.gz

Step #4: Compile

cd unrealircd-6.2.6
./Config
make
make install

Step #5: Pre-configuration

cd ~/unrealircd
cp conf/examples/example.conf conf/unrealircd.conf
./unrealircd gencloak

Step #6: Configuration of cloak-keys

  • Copy cloak keys (everything inside: set { cloak-keys etc. })
  • Run WinSCP and login to your server with username unrealircd on port 22
  • Open /home/unrealircd/unrealircd/conf/unrealircd.conf
  • Search (CTRL+F) for cloak-keys and replace cloak-keys { } and save

Step #7: Configuration of unrealircd.conf with WinSCP

Make backup of unrealircd.conf to unrealircd.conf.backup

Step #8: Linking servers

./unrealircd spkifp

Run commands from ~/unrealircd directory:

Start./unrealircd start
Stop./unrealircd stop
Restart./unrealircd restart
Rehashing./unrealircd rehash
Status report./unrealircd status
Testing your config./unrealircd configtest
Hash a password./unrealircd mkpasswd
Upgrade./unrealircd upgrade
Upgrade to release candidate./unrealircd upgrade –rc
Generate cloak keys./unrealircd gencloak
Calculate spkifp./unrealircd spkifp

Step #4 – Cronjob (autorun) for Unreal IRC daemon

  • Login as user unrealircd
  • Run command crontab -e
  • When editor is open, paste in these to lines (NOTE: make sure there is an enter at the end):
*/5 * * * * /home/unrealircd/unrealircd/unrealircd croncheck
@reboot /home/unrealircd/unrealircd/unrealircd croncheck
  • Save by CTRL-O (write files)
  • Quit by CTRL-X (exit editor)

Step #5 UnrealIRCd Administration WebPanel (optional)

https://www.unrealircd.org/docs/UnrealIRCd_webpanel

Step 1 – Install Apache Web Server:

  • sudo apt update && sudo apt -y upgrade
  • sudo apt -y install apache2 libapache2-mod-php

Step 2 – Install PHP:

  • sudo apt -y install php php-zip php-curl php-mbstring

Step 3 – Install composer:

  • sudo apt -y install composer

Step 4 – Open port using UFW (Uncomplicated Firewall):

  • sudo ufw allow 80/tcp comment “www” && sudo ufw limit 80
  • sudo ufw allow 8600/tcp comment “IRCd-webpanel” && sudo ufw limit 8600

Step 5 – Configure UnrealIRCd:

Put this in conf/unrealircd.conf:

include "rpc.modules.default.conf";

/* HTTPS on port 8600 for the JSON-RPC API */
listen {
        ip *;
        port 8600;
        options { rpc; }
}

/* API user */
rpc-user adminpanel {
        match { ip 127.*; }
        rpc-class full;
        password "password";
}

When file is saved, rehash UnrealIRCd server using this command ./unrealircd rehash

Configure the Web Panel:

cd /var/www/html
sudo git clone https://github.com/unrealircd/unrealircd-webpanel
sudo chown www-data:www-data unrealircd-webpanel -R
cd unrealircd-webpanel
sudo -u www-data composer install

Step #6 – Atheme IRC Services

https://github.com/atheme/atheme/blob/master/INSTALL


Step #1: Prerequisites

sudo apt-get install git -y

Step #2: Create a new user (due to security, do not install services as root)

sudo adduser atheme
su atheme

Step #3: Download Services

git clone --recursive 'https://github.com/atheme/atheme/' atheme-devel
cd atheme-devel

Step #4: Compile

./configure --enable-contrib
make
make install

Step #5: Pre-configuration

cd /home/atheme/atheme/etc/
cp atheme.conf.example atheme.conf
nano atheme.conf

Run commands from ~/atheme/ directory:

Build databaste./bin/atheme-services -b
Start./bin/atheme-services
Rehashpkill -HUP atheme-service
Stoppkill atheme-service

Step #7 – Cronjob (autorun) for Atheme IRC Services

  • Login as user atheme
  • Run command crontab -e
  • When editor is open, paste in these to lines (NOTE: make sure there is an enter at the end):
*/5 * * * * /home/atheme/atheme/bin/atheme-services
@reboot /home/atheme/atheme/bin/atheme-services
  • Save by CTRL-O (write files)
  • Exit by CTRL-X (exit editor)