Irc server ready for windows local network. Installing an IRC server - ngIRCd

Irc server ready for windows local network. Installing an IRC server - ngIRCd

One of the purposes of introducing some Linux users is to study the operation and settings of various servers and services. Due to the openness of this operating system learning to administer the system is much easier than in Windows, for which most projects are far from free, and finding a distribution kit is not easy. In this article we will help readers by analyzing the setup of one of the IRC servers. Why IRC? If you search on thematic resources, you will find that for Linux and Unix there is a large number of guides for setting up Internet servers, most often Apache, various versions of mail systems, differing in the components used and variations on the topic of combating spam and viruses. Finding a manual for the others is much more difficult. This is especially true for the old IRC, which has been honestly fulfilling its duty for several decades, withstanding numerous battles, the main resources of IRC are perfectly standing on their feet. And despite the invasion of newer services like LiveJournal, it seems they are not going to give up. Newbies are constantly appearing. Today you won’t surprise anyone with networks connecting entire regions, so why not try yourself in IRC administration.

Today, there are several dozen, if not hundreds of solutions available for building an IRC server. Some of these projects originate from the first IRCD server (http://www.nic.funet.fi/~irc/server/), respectively, and often carry its legacy with them. There are systems designed for a large number of users that require a database that supports the exchange of information via the secure SSL protocol. You can compare some of the features of popular solutions at http://en.wikipedia.org/wiki/Comparison_of_IRCds. We will turn to a project that does not claim to be the first, the best, and so on; it cannot boast of having a large number additional features. Stability and security are here keywords- ngIRCd (Next generation IRC Daemon).

?ngIRCd features

This server was written by the author Alexander Barton completely from scratch, in the C language. The main attention during its design was paid to code portability and code cleanliness. As a result, ngIRCd builds easily on most platforms. In addition to Linux, these are: AIX, A/UX, FreeBSD, HP-UX 9.10/10.20, HP-UX, IRIX, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin libraries. During assembly, ngIRCd does not require any hidden dependencies; it compiles just perfectly. The clear configuration file makes the setup easier; perhaps with increased functionality it will become somewhat more complicated, but I hope the basic principle will remain the same. Also ngIRCd is compatible with all IRC servers that comply with RFC 1459, 2810-2813 specifications, which means most commands and everything expected from similar service regular user. It’s probably too early to use it in large networks. And the author himself honestly warns that ngIRCd has not yet been tested on busy IRC networks with high load. But in small networks and for training purposes it can be recommended. Moreover, as experience shows, he is not very afraid of heavy loads. By the way, the ngIRCd server can work not only with a static address, but behaves normally if the address is assigned to the system dynamically. If only users knew where to join. To increase security, the server can easily chroot the environment, and if problems arise, the attacker will not go further than the specified directory. The project home site is http://ngircd.barton.de/.

Installing ngIRCd

The repository of the KUbuntu 6.06 Daper Drake distribution, which was used during the test installation, contains ngIRCd. Installing it is simple.

$ sudo apt-get update

$ sudo apt-get install ngircd

True, at the time of writing this was no longer a current version - 0.9.2, while 0.10.1 was available on the project website. For those who do not want to compile, you can take a ready-made package for Ubuntu 7.04, which contains version 0.10, or an alternative package for Debian ftp://arthur.barton.de/debian/pool/main/n/ngircd/, which is supported by Alexander. Compiling is easy, so it's easier to build it yourself.

$ wget -c ftp://ftp.berlios.de/pub/ngircd/ngircd-0.xx.1.tar.gz

$ tar xzvf ngircd-0.xx.1.tar.gz

$ cd ngircd-0.xx

And configure it. You can run the script without parameters, but I enabled IRC traffic capture, quite useful opportunity when studying the protocol. I also don’t like it when programs are installed in /usr/local, and configuration files are scattered throughout the tree. Therefore, I specified /usr as the installation directory, and the configuration file will be located in /etc.

$ ./configure --enable-sniffer --sysconfdir=/etc --prefix=/usr
Once configuration is complete, a summary of the settings will be displayed.

ngIRCd 0.xx has been configured with the following options:

Target: i686-pc-linux-gnu

Compiler flags: -pedantic -g -O2 -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes -DSYSCONFDIR=""$(sysconfdir)"'

Libraries: -lz -lnsl

'ngircd' binary: /usr/sbin

Configuration file: /etc

Manual pages: /usr/man

Documentation: /usr/share/doc/ngircd

Syslog support: yes Enable debug code: yes

zlib compression: yes IRC sniffer: yes

Use TCP Wrappers: no Strict RFC mode: no

Zeroconf support: no IRC+ protocol: yes

IDENT support: no I/O backend: “epoll()”

And then standard compilation.

$ sudo make install

That's all. The entire assembly process will not take you more than two or three minutes.

ngIRCd configuration file

When started, the daemon reads all settings from a single configuration file ngircd.conf. If configured as shown above, it is now located in the /etc directory. The file structure is traditional for Unix; the settings of most servers look something like this. The file is divided into several sections, each with specific settings. Moreover, if it is planned to work several virtual servers ngIRCd, their settings are described in one file. It’s convenient that it is well commented, and the keywords are clear in meaning, so you can understand the meaning of the parameter without even looking at the documentation. The sharp sign “#” and the semicolon “;” mean comment. The documentation is also worth special praise, it is written simply and clearly; if you know basic English, it will be easy to navigate. Most of the parameters can be left by default, that is, commented out.

Let's start editing.

$ sudo mkedit /etc/ngircd.conf

# Section describes basic server settings

# Server name on the IRC network.

Name = irc.grinder.net

# server information that will be displayed when using the WHOIS and

Info = My First IRC Server

# Password for joining the server, if not set, then users will connect without a password

# information about the server and administrator

AdminInfo1 = My IRC

AdminInfo2 = Home

AdminEMail = [email protected]

# By default the server uses port 6667, you can specify other values ​​separated by commas

;Ports = 6667, 6668, 6669

# By default the server waits for a connection on all network interfaces, which is not always

# need to. Using this parameter, you can point to the desired interface

;Listen = 1.2.3.4

MotdFile = /etc/ngircd.motd

# If you are not using a motd file, you can specify a short (256 characters) message here

;MotdPhrase = "Hello world!"

# By default the daemon will run as user nobody

# The presence of a sick number of such nobody in the system makes this user no less

# significant than root. Using these parameters, you can specify the user and group

# on behalf of which the daemon will run after launch

# It must be on the system and all files must belong to this user

ServerUID=ngircd

ServerGID=ngircd

# chroot the directory where the daemon will go after starting

;ChrootDir = /var/empty

# File with the process number of the ngircd daemon, if chroot is not planned, you can leave it alone

;PidFile = /var/run/ngircd/ngircd.pid

# After this time, a PING will be sent to the client to find out whether he is alive or not

PingTimeout = 120

# if the client does not respond to PING with a PONG message, it will be disconnected after this time

PongTimeout = 20

# period of time after which an attempt to connect to other servers will be made

;ConnectRetry = 60

# Allow the use of the MODE command, which sets the channel mode

;OperCanUseMode = no

# masking the request as if it were coming from the server

;OperServerMode = no

# use only preset channels

;PredefChannelsOnly = no

# maximum number of connections the server will accept

# (<=0: без ограничений):

;MaxConnections = -1

# also only from one IP address

;MaxConnectionsIP = 5

# maximum number of channels a user can be present in

# This section defines IRC operators, each with its own section

Name = Operator1

Password = password

# IRC channels automatically created by the server.

# Each channel is described in a separate section

# Channel name

# Theme for the channel

Now all that remains is to create the ngircd user and assign him as the owner of /etc/ngircd.motd.

$ sudo adduser ngircd --no-create-home --disabled-login

Adding user `ngircd’…

Adding new group `ngircd’ (1003).

Adding new user `ngircd’ (1003) with group `ngircd’.

Not creating home directory `/home/ngircd’.

Changing the user information for ngircd

$ sudo chown ngircd:ngircd /etc/ngircd.motd

All is ready. Let's launch.

We configure the IRC client on the new server and communicate. I checked the server's operation with all CP1251, KOI8R, KOI8U and UTF8 encodings. When using ngIRCd, there were no problems with displaying messages in Cyrillic, the main thing was that the clients were configured in the same way.

You can view the message exchange process in the file /var/log/messages.

$ sudo cat /var/log/messages | grep ngircd

Feb 25 19:14:01 localhost ngircd: Reading configuration from “/etc/ngircd.conf” ...

Feb 25 19:14:01 localhost ngircd: No administrative information configured but required by RFC!

Feb 25 19:14:01 localhost ngircd: Running as user ngircd(1003), group ngircd(1003), with PID 10801.

Feb 25 19:14:01 localhost ngircd: Not running chrooted.

Feb 25 19:14:01 localhost ngircd: IO subsystem: epoll (hint size 100, initial maxfd 100, masterfd 4).

Feb 25 19:14:01 localhost ngircd: Now listening on 0.0.0.0:6667 (socket 5).

Feb 25 19:14:50 localhost ngircd: Accepted connection 6 from 192.168.1.58:59018 on socket 5.

Feb 25 19:14:50 localhost ngircd: Possible forgery: 192.168.1.58 resolved to grinder (which is at ip 127.0.0.1!)

Feb 25 19:14:50 localhost ngircd: User « [email protected]» registered (connection 6).

Feb 25 19:15:24 localhost ngircd: Accepted connection 7 from 192.168.1.58:59019 on socket 5.

Feb 25 19:15:24 localhost ngircd: Possible forgery: 192.168.1.58 resolved to grinder (which is at ip 127.0.0.1!)

Feb 25 19:15:30 localhost ngircd: User « [email protected]» registered (connection 7).
So we learned how to set up our IRC server. Although ngIRCd does not have some of the functionality found in more advanced products, it is a start. Linux forever!

Ubuntu repositories host many IRC (Internet Relay Chat) servers. This section will cover how to install and configure the original IRC server ircd-irc2.

Installation

to install ircd-irc2, run the following command at the command prompt:

Sudo apt-get install ircd-irc2

Configuration files are saved in the /etc/ircd directory. The documentation will be available in the /usr/share/doc/ircd-irc2 directory.

Settings

IRC settings can be made in the /etc/ircd/ircd.conf configuration file. You can set the server's network name in this file by changing the following line:

M:irc.localhost::Debian ircd default configuration::000A

Please make sure you have added DNS entries for the IRC server's network name. For example, if you set your IRC netname to irc.livecipher.com, make sure that irc.livecipher.com is resolved by your DNS server. The IRC netname does not have to be the same as the public netname.

The IRC admin information can be customized by editing the following line:

A:Organization, IRC dept.:Daemon :Client Server::IRCnet:

You can add separate lines to configure the list of listening IRC ports, to configure Operator information, to configure client authorization, etc. Refer to the example configuration file /usr/share/doc/ircd-irc2/ircd.conf.example.gz for details.

The IRC header that will be shown on the IRC client when connecting to the server can be set in the /etc/ircd/ircd.motd file.

After making the necessary changes to the configuration file, you need to restart the IRC server using the following command:

Sudo /etc/init.d/ircd-irc2 restart