IRC (Internet Relay Chat) Tutorial

From distributed.net
Jump to: navigation, search

Introduction

IRC (Internet Relay Chat) is a way of communicating in real time with people all over the world. IRC is similar to instant-messaging tools such as ICQ or MSN Messenger except that it is focused on group conversations instead of person-to-person messaging. distributed.net owes its existence to IRC and IRC is likely to always be the most effective way of getting help using dnetc if the FAQ doesn't have the answer to your question.

The channel #distributed normally has quite a few people in it and ranges in activity from hectic to very quiet. You will be able to chat with whoever is in the channel at the time. Although it's the official distributed.net channel the discussion can frequently stray to other topics.

distributed.net uses its own IRC network which is the home of all the official distributed.net channels. Other users and organizations are welcome to maintain non-distributed.net channels on this network. You may access the network by connecting to alias irc.distributed.net which will connect you to one of the public servers at random.

One of the reasons that distributed.net chooses to run its own network is to provide secure and encrypted access to the IRC network. You can connect to any of the public servers on port 994 with an ssl-wrapped connection and enjoy the benefits of truly private communications to the network. Please read this document for more details on enabling irc-ssl in your environment.

There are some rules designed to limit inappropriate behaviour on our IRC channel which can be found in our policies document.

Popular IRC Client Software

In order to use IRC (Internet Relay Chat), you will first need to download an IRC Client if you have not already done so. Popular IRC clients for major platforms are:

Windows: mIRC
Mac OS X: ircle or Colloquy
Unix X GUI: xchat
Unix Console: EPIC or irssi
Web browser based: Mibbit AJAX client or Chatzilla

In addition to the above suggestions, there are many other options available for Windows and Unix.

Once you have downloaded a client, you will need to configure the software. Use the documentation provided with the software to do this.

The two main settings that need to be configured are a nick name you are going to be identified by and selection of one or more IRC servers you will use to connect to the IRC network.

IRC Basics

The people on #distributed normally include DCTI staff and experienced users of the client from around the world, so it's more than likely that someone will be able to help if you have a question concerning any aspect of distributed.net. A number of the DCTI staff are Channel Operators (Ops). Ops can be identified by a @ before their nick in /names listings and generally highlighted in some way in the user lists in GUI IRC clients. Channel Operators monitor the channel, and will kick (remove) anyone whose behaviour is not acceptable. When you join the channel, until you get used to using IRC, it is a good idea just to watch for a few minutes and see what's going on, also known as "lurk".

For a more detailed primer on IRC usage and information, try http://www.irchelp.org/.

Advanced Usage: irc-ssl

Although many channels, such as #distributed are public and don't require encryption to protect the discussions that take place within them, being able to secure your connection to the IRC network is valuable for protecting the privacy of private messages to other users or services bots as well as protecting the communications in any non-public channels you may join. All distributed.net IRC servers support secure SSL connections to port 994 to enable this.

Secure IRC is still relatively rare and the number of IRC clients which natively support it are scarce. The Unix client xchat has the most mature support we've seen. If you prefer a console client, we recommend irssi which also supports ssl natively. Fortunately, it's possible to use a great package called stunnel to wrap around any normal irc client in both Windows and Unix to enable an irc-ssl connection.

For Unix, the procedure depends on whether you have the current or an older version of stunnel. For the current version (4.x) you will need to create a configuration file called stunnel.conf in your home directory with the following:

 client = yes
 verify = 0
 delay = yes
 [dnet]
 accept = 6667
 connect = irc.distributed.net:994
 TIMEOUTclose = 0

Then run the following commands in your home directory, after substituting the name of your irc client and your nick:

  $ stunnel stunnel.conf
  $ ircii MyNick www.distributed.net

For older versions of stunnel (3.x or earlier), you'll want to do something along the lines of the following, after substituting the name of your irc client and your nick:

  $ stunnel -c -d www.distributed.net:6667 -r irc.distributed.net:994 &
  $ ircii MyNick www.distributed.net

This runs stunnel as a daemon, encrypting your local port 6667 to the distributed.net IRC network. Then you're simply running your normal IRC client and connecting to "www.distributed.net" instead of the remote server.

Windows usage is very similar:

  1. Download and install stunnel
  2. Create a file stunnel.conf in the same location as the stunnel executable with the same content as the Unix description above.
  3. Start | Run the following command (changing the path to where you installed the executable if not "Program Files" directory)
    C:\Program Files\irc-stunnel\stunnelw.exe
    You should see a little white SSL box appear in your system tray.
  4. You may wish to consider adding that command to your Startup folder.
  5. Run your IRC client and configure it to connect to "www.distributed.net" instead of a remote server. In mIRC, this is simply a matter of typing "/server localhost" in your mIRC window.

mIRC users in Windows have far easier options:

xchat-ssl note: At the moment, all of the IRC servers are using self-signed certificates, which xchat considers invalid. You'll have to check the "accept invalid certificates" check box in order to use xchat-ssl until we correct this.

Advanced Usage: Services

The distributed.net IRC network runs a comprehensive suite of services bots which are responsible for maintaining the sanity and integrity of the users and channels on the IRC network. Regular users of the network are encouraged to utilize these bots to make their IRC experience more useful.

NickServ allows you to register your nick with the network and protect it with a password to prevent people other than you from using your nick when you are not connected to IRC. Registering your nick is also the foundation required in order to use most of the other services on the network.

Once you've connected using the nick you wish to register, simply send a message to NickServ in the form of:

  /msg NickServ register <password> <email address>

This will register the nickname to you, and protect it with a password. Please be careful! There's no way to recover this password if you lose it! (Well, to be fair, the passwords are stored DES encrypted, so we could sponsor a distributed.net DES project to brute-force your lost password, but would you really want everyone to know you lost it?)

After having registered your nick, you'll want to automate the registration process in your IRC client. Sample scripts for many popular clients are provided below. If you create a script for a client not featured here, please consider mailing it to nugget@distributed.net so we can add it.

As with all the bots, you can /msg NickServ help for detailed help.

ChanServ allows you to register channels on the network and control who can join them and set other permanent attributes for it. Most users will not need to use ChanServ services.

MemoServ allows you to leave messages for other registered nicks, even if that person is not currently online. Other users can use MemoServ to send messages to you, as well. Sample usage:

  /msg MemoServ send Nugget Cows are cool!
  /msg MemoServ list

Advanced Usage: Non-standard Stuff

As part of the UnrealIRCd package, the distributed.net IRC network supports a number of extensions to the traditional IRC experience which you may not be familiar with. Please be aware of the following features which may be different from other IRC networks you may have used:

  • By default, users connect with mode +x which instructs the server to partially obscure their hostname or IP Address. When other users do a /whois on a +x'd user, instead of seeing "Nugget (nugget@dazed.macnugget.org)" they will see "Nugget (nugget@moo-29348.macnugget.org)" which has replaced a portion of the FQDN with a randomized string. While this is nice for preventing malicious users from port-scanning you or ping flooding you, it can prevent normal DCC operation. If you find that you are unable to use the DCC features of your IRC client, try doing a "/umode -x" to disable this feature.

The following is a list of user mode flags and their meanings:

User mode Meaning
o Global IRC Operator
O Local IRC Operator
i Invisible (Not shown in /WHO searches)
w Can listen to Wallop messages
g Can read & send to GlobOps, and LocOps
h Available for Help (Help Operator)
s Can listen to Server notices
k Sees all the /KILLs which were executed
S For Services only. (Protects them)
a Is a Services Administrator
A Is a Server Administrator
N Is a Network Administrator
T Is a Technical Administrator
C Is a Co Administrator
c See's all Connects/Disconnects on local server
f Listen to Flood Alerts from server
r Identifies the nick as being Registered
x Gives the user Hidden Hostname
e Can listen to Server messages sent to +e users (Eyes)
b Can read & send to ChatOps
W Lets you see when people do a /WHOIS on you (IRC Operators only)
q Only U:lines can kick you (Services Admins only)
B Marks you as being a Bot
F Lets you receive Far and Local connect notices
I Invisible Join/Part. Allows you to be hidden in channels
H Hide IRCop status in /WHO and /WHOIS. (IRC Operators only)
d Stops you receiving channel PRIVMSGs (Deaf)
v Receive infected DCC send rejection notices
t Says that you are using a /VHOST
G Filters out all Bad words in your messages with <censored>.
z Marks the client as being on a Secure Connection (SSL)

The following is a list of channel mode flags and their meanings:

Channel mode Meaning
p Private channel
s Secret channel
i Invite-only allowed
m Moderated channel, Only users with mode +voh can speak.
n No messages from outside channel
t Only Channel Operators may set the topic
r Channel is Registered
R Requires a Registered nickname to join the channel
c Blocks messages with ANSI colour (ColourBlock).
q Channel owner
Q No kicks able in channel unless by U:Lines
O IRC Operator only channel (Settable by IRCops)
A Server/Net/Tech Admin only channel (Settable by Admins)
K /KNOCK is not allowed
V /INVITE is not allowed
S Strip all incoming colours away
l <number of max users> Channel may hold at most <number> of users
b <nick!user@host> Bans the nick!user@host from the channel
k <key> Needs the Channel Key to join the channel
o <nickname> Gives Operator status to the user
v <nickname> Gives Voice to the user (May talk if chan is +m)
L <chan2> If +l is full, the next user will auto-join <chan2>
a <nickname> Gives protection to the user (No kick/drop)
e <nick!user@host> Exception ban - If someone matches it they can join even if a ban matches them
h <nickname> Gives HalfOp status to the user
f [*]<lines>:<seconds> align="center"banned
H No +I users may join (Settable by Admins)
N No Nickname changes are permitted in the channel.
G Makes the channel G Rated. Any badwords are replaced with <censored> in channel messages (badwords.channel.conf).
u "Auditorium". Makes /NAMES and /WHO #channel only show Operators.
C No CTCPs allowed in the channel.
z Only Clients on a Secure Connection (SSL) can join.

Services Script for BitchX

# irc.distributed.net services script by nugget@macnugget.org
# A more compilcated version of this that understands the concept of
# windows can be found at http://macnugget.org/stuff/irssi/.bitchxrc
#
# This code only works if you have SET KILL ON for your nick.
#
# This probably works in epic/ircii, too, but isn't tested.
assign CUCKOO_PASSWORD **PASSWORD**
assign CUCKOOIDENT services@irc.cuckoo.com
alias nsreg {
 userhost NickServ -cmd {
   if ( rmatch($3@$4 $CUCKOOIDENT) ) {
     echo NSREG: Sending CuckooNet Credentials
     ^msg NickServ identify $CUCKOO_PASSWORD
   }
 }
}
on ^notice "NickServ This nickname is registered and protected. *" {
 ^nsreg
}
alias csjoin {
 userhost NickServ -cmd {
   if ( rmatch($3@$4 $CUCKOOIDENT) ) {
     ^msg MemoServ list
     join #distributed
   }
 }
}
on ^notice "NickServ Password accepted *" {
 ^csjoin
}

Services Script for mIRC

Place this in the "remote" script file (thanks Rayden!). The purpose of delaying the "/join #distributed" is to provide an example of such behavior. While delaying the join isn't necessary for a public channel like #distributed, it is necessary to do so for joining restricted-access channels that require you to be registered prior to joining.

As with the BitchX script, this one presumes that you have nickserv configured to challenge you for a password when you assume the nick. "/msg nickserv set kill on" to enable such protection.

You should disable the "auto-join" or "rejoin" on connect option in mIRC to prevent the client from attempting to join your channels before the registration takes place.

  on 1:NOTICE:This nickname is registered and protected*:?:{
    if ($network == CuckooNet) {
      /msg nickserv identify PASSWORD
    }
  }
  on 1:NOTICE:Password accepted*:?:{
    if ($network == CuckooNet) {
      /msg memoserv list
      /join #distributed
      /join #dcti-tunes
    }
  }

Services Script for xchat

There is a nice xchat script written by Mike McDonald which works with the services code running on the distributed.net IRC network. You can grab that script from http://www.foxproject.org/~mike/xchat/


Services Script for irssi

With perl-based scripting, it's possible to do some really fancy things in irssi. There's a robust and featureful nickserv script available which was originally written by Sami Haahtinen. Nugget added on support for deferred channel joins and has published his copy at http://macnugget.org/stuff/irssi/scripts/nickserv.pl