How to set up ircd-hybrid and hybserv on ubuntu 12.04

When setting up the Start-Up Chile IRC chatroom I found it difficult to get an up to date tutorial on how to set up and IRC server and getting Chanserv and Nickserv operational.

This blog post details how to set up Hybrid IRC and Hybserv (which provides nickserv and chanserv) on Ubuntu 12.04.

Setting Up Basic IRC

Install the irc server.

sudo apt-get update
sudo apt-get install ircd-hybrid

Configure the IRC Server:

sudo nano /etc/ircd-hybrid/ircd.conf

Alter the name and description in the ‘serverinfo{}’ section to reflect your organisation.

serverinfo { /* name: the name of our server */ name = "hybrid7.debian.local"; /* description: the description of our server. '[' and ']' may not * be used here for compatibility with older servers. */ description = "ircd-hybrid 7.2-debian"; .... CONFIG CONTINUES ....

Comment out the host line in the listen{} section. This enables the server to receive connection from clients other than local host.

listen { /* port: the specific port to listen on. if no host is specified * before, it will listen on all available IPs. * * ports are seperated via a comma, a range may be specified using ".." */ /* port: listen on all available IPs, ports 6665 to 6669 */ #host = ""; # change this! port = 6665 .. 6669; };

Finally before opening up the chat server to the world change the oper password. The oper user has total control over the chat server. By default the oper user can only connect via local host, however it is best practise to change the password in any case.

In another terminal window create a password using mkpasswd.

mkpasswd [your password]

Copy the password to your clipboard and insert it into the operator{} section of the ircd.conf file.

operator { /* name: the name of the oper */ name = "root"; /* user: the [email protected] required for this operator. CIDR is not * supported. multiple user="" lines are supported. */ user = "[email protected]"; /* password: the password required to oper. By default this will * need to be encrypted using '/usr/bin/mkpasswd'. * WARNING: Please do not mix up the 'mkpasswd' program from * /usr/sbin with this one. If you are root, typing 'mkpasswd' * will run that one instead and you will receive a strange error. * * MD5 is supported. If you want to use it, use mkpasswd -Hmd5. */ password = "ToJx.IEPqjiVg"; //<-- REPLACE THIS PASSWORD #password = "$1$9PTzrFkW$yh3ablZ5DnHeU9yjhj..U/";

Restart the irc server.

sudo /etc/init.d/ircd-hybrid restart

You should now be able to connect to the server (use your favorite client such as Colloquy, mIRC or epic4).

Installing & Configuring Hybserv

I couldn’t find hybserv in the apt repository for ubuntu 12.04 so I chose to download and compile it myself.

Hybserv2 is hosted on source forge. Find the download link by going to The Download Page

Use the download ink to get the files on your server:

wget [download url]

Un tar the archive that has just been downloaded:

tar xvfz [filename of download]

Ensure compiler and build tools are installed.

sudo apt-get install build-essential

Compile hybserv:

 sudo make &amp;&amp; sudo make install

This command should have compiled hybserv 2 to the path ‘/usr/local/hybserv’

cd /usr/local/hybserv

Change the owner of all these files to the irc user.

sudo chown -R irc:irc .

Next configure ircd-hybrid and hybserv to talk to each other.

Pick a name for the hybserv server. In the examples below I chose

Firstly configure ircd-hybrid to accept connections from

sudo nano /etc/ircd-hybrid/ircd.conf

Currently the ‘connect{}’ section is commented out. Delete the current ‘connect{}’ sections and replace it with the following:

connect { /* name: the name of the server */ name = ""; /* host: the host or IP to connect to. If a hostname is used it * must match the reverse dns of the server. */ host = ""; /* passwords: the passwords we send (OLD C:) and accept (OLD N:). * The remote server will have these passwords reversed. */ send_password = "password"; accept_password = "password"; /* compressed: controls whether traffic is compressed via ziplinks. * By default this is disabled */ compressed = no; hub_mask = "*"; class = "server"; };

Restart ircd-hybrid:

sudo /etc/init.d/ircd-hybrid restart

Now in the hybserv config file configure hybserv to connect to the ircd-hybrid server.

sudo nano /usr/local/hybserv/hybserv.conf

Delete the contents of the file (if using nano ctl + k makes this less painful).

Change the ‘o:’ line to use the password you created initally in the first section of the guide.

Change the ‘n:’ line to use the host name chosen above and present in ircd.conf.

Change the ‘s:’ line to use the plain text password specified in the connect{} section of ircd.conf above.

O:*@*:[YOUR PASSWORD]:root:segj A:Debian User services S:password: C:#services

NOTE: The host name you choose for hybserv must not clash with any other host names on your netwrok. eg if your ircd-hybrid server is called then you may not use this for your hybserv host name. Doing so will give you an annoying error message

From the hybserv directory start hybserv:

sudo su irc

Log into your irc server. Test hybserv is working by attempting to communicate with nickserv. If you get a response your hybserv installation was a success!

/msg nickserv help

If this doesn’t work I find restarting ircd and hybserv usually does the trick.

sudo su irc
 cd /usr/local/hybserv
 /etc/init.d/ircd-hybrid restart
 killall hybserv

If this doesn’t work see the debugging instructions below.

Optimizations For An Organization

By default ircd-hybrid only lets two users connect from the same ip address. If all your users are located in the same office you need to increase this number.

Edit /etc/ircd-hybrid/ircd.conf:

sudo nano /etc/ircd-hybrid/ircd.conf

Find the class that deals with standard users and alter the ‘number_per_ip’ and ‘max_number’ and tailor the values to your needs.

/* class {}: contain information about classes for users (OLD Y:) */ class { /* name: the name of the class. classes are text now */ name = "users"; /* ping time: how often a client must reply to a PING from the * server before they are dropped. */ ping_time = 2 minutes; /* number per ip: the number of users per host allowed to connect */ number_per_ip = 2; /* max number: the maximum number of users allowed in this class */ max_number = 100; /* sendq: the amount of data allowed in a clients queue before * they are dropped. */ sendq = 100 kbytes; };

By default hybserv insists 10 users must be present in channel before it is registered. If your working in small groups you may need to change this setting if you intend to register rooms.

Edit /usr/local/settings.conf:

sudo nano /usr/local/settings.conf

Find the chanserv settings sections and alter the ‘MinChanUsers’ to suit your needs.

# MinChanUsers<value> [RECOMMENDED] # # Set this to the minimum channel users required to # be able to register a channel. MinChanUsers 2

Customising Message Of The Day

When logging into IRC users are greeted with a message. To change the message alter the content of the the MOTD file.

sudo nano /etc/ircd-hybrid/ircd.motd


When attempting to diagnose any issues with your IRC configuration you should first consult the logs for ircd-hybrid and hybserv.

tail -f /var/log/ircd/ircd-hybrid.log
tail -f /usr/local/hybserv/logs/hybserv.log

Happy Chatting!