IRC op cheatsheet
Feb. 12th, 2012 10:34 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
All of this is cut and pasted from http://www.irchelp.org/irchelp/opguide.html, just put together here in formatting I prefer and cut down to the stuff I particularly need.
The main channel modes
There are 7 main channel modes. Which ones you set your channel to will depend on what you want to do.
You can set modes singly or in clumps:
/mode * +nt
is the same as
/mode * +n
/mode * +t
+n
+n means "no notices". this stops people or bots sending notices or msgs to the channel from outside. Your channel should *always* be set +n, to stop low-lifes from flooding it.+t
+t means "topic". If this is set, then only operators can change the topic. You don't have to set this, but in my experience if you don't then you will get flooded with topic changes. No idea why, it just seems to happen that way.+i
+i means "invite only". Anyone who wants to join the channel has to be invited by a channel op. Nice if you don't want drop-ins or as part of a defence against people actively trying to take the channel, but otherwise annoying.+p
+p means "private". If your channel is set +p. then if someone does a /whois on anyone on that channel, the fact they are on that channel will not be revealed. However, it will be obvious that they are on *some* channel.+s
+s means "secret". If your channel is secret, then no answer will be returned if someone does a /names #channel. (Of course if they are *on* the channel when they do this they will see all the people on it.NOTE: A channel cannot be both +p and +s
+k
A channel set +k requires a keyword to enter. On EFnet (the "main" IRC net) this keyword can contain unprintable chars. On UnderNet, only printable chars count.To set the keyword for channel #silveroz to mykey
/mode #silveroz +k mykey
or
/mode * +k mykey
You also need the key to remove the mode... If you know it,
/mode * -k mykey
if you don't, see below.
+m
If you set the channel +m, then only operators or people who an operator has set +v can talk on channel. This is a useful way of dealing with an attack by floodbots.+o
The +o mode is set or unset for particular users. Making a user +o gives the user operator status on the channel. Making a user -o removes operator status.+v [ nickname ]
The +v mode simply gives someone on a +m channel permission to send text to the channel, even if he or she is not an op. (All ops automatically have permission to speak.)+l [ number ]
This sets a limit on the number of people that can join the channel. This mode does not really guarantee that no more than the set number of people will be on channel. For instance, setting this mode does not kick anyone off if the channel is over the limit. And, people who split in totally ignore the +l limitation (just like they ignore every other channel mode limitation.+b [ pattern ]
This mode bans any user who matches from joining. This is covered in-depth in section 2.6.Clearing channel modes
Modes are normally set and cleared by the mode command as follows:
/mode * -n
/mode * -nt
You can combine mode commands too. Supposing the channel was currently +i +n +t (usually written as +int), uou can remove the +i by
/mode * -i
But supposing you want it to be -i but +s?
/mode * -i+s
You can clear all modes (including a keyword you don't know...) by typing:
/eval mode * -$M
NOTE: eval and $M are both commands specific to the ircII IRC client. If you are not using ircII, the above command may not work for you.
Opping and de-opping
To give someone ops, you use the mode command again:
/mode * +o SilverOz
To de-op them:
/mode * -o SilverOz
You can op or de-op up to 3 people at once:
/mode * +ooo SilverOz Tangent Agatha
/mode * -ooo SilverOz Tangent Agatha
Note that the number of "o"s has to match the number of people.
Kicking
To kick someone off the channel, you use the /kick command:
/kick * SilverOz
You can add a comment the person will see when they are ejected:
/kick * SilverOz Good bye and good riddance!
You can only kick one person at a time.
Note that it's often adviseable to ban a user before you kick them -- that way they don't jump back on channel during the interval before the ban takes effect. See section 2.6.1.5 for further details.
When banning, the nick and user and host info are written like this:
nick!user@host1.host2.suffix
e.g. SilverOz!zjohnsto@angus.scu.edu.au
or felix!f-t-cat@whack.cartoon.org
So, anything to the right of the ! is a nick, anything between the ! and the @ is the user portion (also called account, or account name) and anything to the right of the @ is the host.
You can use wildcards in bans, special characters that stand in for a character or group of chars.
? means "any single char"
* means "any group of chars.
So "S?lverOz" will match "SilverOz" and "SolverOz" and "SklverOz" but not "SiilverOz."
"*Oz" will match "SilverOz" and "AgOz" and "SilverOOz" but not "Silver" or "SilverOzz."
"*.hacker.com" will match "bozo.hacker.com" and "luser.hacker.com" but not "hacker.com" itself.
Note that some users can change their account name as easily as the rest of us change our nicks. This means you will have to ban their entire host, or possibly their entire domain, to keep them off the channel.
Types of bans and when to use them
There are several kinds of bans, each one useful for a different purpose, although there are one or two (notably "screwbans" the ones with lots of single ? wild cards in them) which seem to be completely useless.
Nick ban
The correct format for a nick ban is:/mode * +b nick!*@*
This bans anyone with the nick "nick." E.g. /mode * +b SilverOz!*@* will ban anyone with the nick SilverOz from the channel. Of course if they change their nick, then they can slide right past the ban.
This ban is pretty useless against people, but can be used to get rid of bots, who usually don't change their nicks. (Some bots do, though.) It can also be used to get rid of an idle user you have kicked who has auto-rejoin set on, and immediately comes back on channel. In that case, ban them, then unban about 5 mins later.
User@host ban
The correct format for a user@host ban is as follows:/mode * *!*user*@*host.suffix
This is your standard everyday ban. It bans all nicks (*! means "all nicks") from their username (*user* means their username, plus the * at the beginning takes care of the ~ mark you sometimes see, and the * at the end insures that the username you provide "fits" into the space -- no more than nine characters will fit), from all machines in their domain.
E.g., to ban SilverOz who is zjohnsto@scu.edu.au you would type:
/mode * +b *!*zjohnsto*@*scu.edu.au
To ban Luser who is lame@mm.elcheepo.edu you would type:
/mode * +b *!*lame*@*elcheepo.edu
Note that for the non-US address (.au means Australia) you leave 3 parts of the host name, for the US one, you only leave 2.
Most scripts would write the ban as:
/mode * +b *!*lame*@*.elcheepo.edu
which works OK unless you get someone with a 2 part hostname, e.g., luser has another account, joe@hacker.com, with access to joe@phreak.hacker.com and joe@hacker.com.
/mode *!*joe*@*.hacker.com will ban the first account, but not the second.
Site ban
The format for an effective site ban is as follows:/mode * +b *!*@*host.suffix
This bans everyone from a particular domain or machine, no matter who they are, or what their nick.
For example, if you wanted to ban SilverOz and everyone from SCU, you would type:
/mode * +b *!*@*scu.edu.au
Then it wouldn't matter who the person was, if they were on an scu machine, they will be banned.
You can also ban users from particular machines, so if you wanted to ban users from alsvid.scu.edu.au but not angus.scu.edu.au, you could type
/mode * +b *!*@alsvid.scu.edu.au
Banning by IP address
Some servers don't give the machine name when you do a whois, they give a series of numbers, which is the "IP address".A numeric address is actually the person's "IP" address, and sometimes simply banning the whole IP address is good enough. E.g.:
/mode #bdsm +b *!*zjohnsto*@203.2.20.1
If the person being banned actually has access to other hosts on that network, or can change to another IP address that they own, it gets more complex. There are three basic types addresses that you can get when you register a network: Class A, Class B, and Class C. A Class C network is a small network - no more than 255 hosts on it, and is the most common you should see. In a class C network address only the last number will change. If I knew SilverOz was on a class C network, I could do a site ban on her with:
/mode #bdsm +b *!*zjohnsto@203.2.20.*
A class B network is larger, up to 65535 hosts, and the last two components of the address can differ. For a class B you would use
/mode #bdsm +b *!*zjohnsto@203.2.*
Class A is 16777215 hosts and all three of the final compoentents can change. There are only 255 class A networks - all owned by large corporations. Many networks, especially the larger ones, are subnetted, which means that even if the hacker is on a large network, the piece they are on can probably be banned simply by wildcarding the last part of the address.
Ok - cut to the chase.
Networks from 128-191 are Class B.
Networks from 192-223 are Class C.
Treat everything else as Class A.
You can ban by /mode * +b *!*zjohnsto*@203.2.20* but that will ban people from 203.2.202.4 for example, quite likely a completely different domain. The moral: include the ending period when banning by IP address.
Now you know more than you ever wanted to about IP network addressing.
Clearing bans
To check what bans are on the channel, type
/mode * b
(NOTE: This works regardless of whether you are on or off channel, but of course if you are off channel you have to use the channel name, /mode #channel b.)
To clear old bans you have to remove them *exactly* as they were written - a terminal with cut and paste is invaluable for this. If you make a mistake, the system won't warn you, it will tell you the ban is removed, even when it hasn't been. You must get the ban exactly right.
To clear a ban:
/mode * -b
e.g.
to clear the ban *!*zjohnsto*@*scu.edu.au
/mode * -b *!*zjohnsto*@*scu.edu.au
Why a ban may not work
Sometimes you ban someone, and they come right back onto the channel anyway. This could be that you didn't ban them properly in the first place! But if the ban looks OK, then there may be something else....
Too many bans
A channel can only hold(The ban list limit is server set, and may be higher or lower depending on network policy; Sorcery.net appears to set it at 50, with the option to go larger.)
If that happens, then clear one or more bans, and try again.
Similar bans
If there is already a ban in place that is similar to the one you are trying to place, then yours won't work. Remove the bad or redundant ban, and try again.How similar is similar, you ask? Well, a ban is deemed "too similar" if the nickname portion or the user and host portion of the ban match the parameters of any other already existing ban.
Desynched servers
This is a nasty problem. If a server becomes desynched, then a hacker can get on the channel on that server because the ban you just placed won't be in the split server's memory. Thus, the hacker can leave and rejoin at will, and to you, it looks like the hacker joined, ban or no ban. See Section 1.3 What happens when a server splits.Split servers
When a split server rejoins, all the people on the split server join the channel on the other server, period. Bans do not matter. You can kick them off once they have joined, of course, but bear in mind that this is not always a good idea, necessarily, especially during a takeover attempt, because they will still be able to see what you say, but you won't see what they are saying!By the way, there is no announcement that the person that just joined did so because of a split -- it looks exactly like a regular join
Modern IRC server software can bring de-split users in with a custom host name (username@net.split is popular) to help ops understand.
no subject
Date: 2012-02-15 06:28 am (UTC)The ban list limit is server set, and may be higher or lower depending on network policy. Also modern IRC server software can bring de-split users in with a custom host name (username@net.split is popular) to help ops understand.
no subject
Date: 2012-02-15 10:58 am (UTC)Essentially it's due to a floodbot appearing on the #exalted channel I'm one of the ops for, whilst we had three ops online but only one watching the room, and that one (me) couldn't immediately remember the right syntax for the more complex bans.
So, we've now added a couple more ops to the channel, one requested a cheatsheet, and I thought I could use one as well so I put it here.
What I'd do now with the floodbot is +m, then voice the actual members of the channel, then ban it.
no subject
Date: 2012-02-15 12:13 pm (UTC)no subject
Date: 2012-02-15 01:12 pm (UTC)Apart from the flooder, I think the other spammer's I've had to deal with have all been successfully dealt with by a kick and a nick-ban.
no subject
Date: 2012-02-15 01:26 pm (UTC)