IRC.md (22405B)
1 # IRC Rite 2 3 Here is the rite of passage for IRC in which you'll learn its arts and crafts. All these are completely optional steps, except for [most used commands](#step-5-most-used-commands) and [netiquette](#step-6-netiquette) of course, but will greatly improve your experience. For the purpose of this guide I will focus on typing commands as this way is compatible with most clients. In the examples, what is described between a "<" and an ">" is not literal but to be filled with the appropriate reference. The examples preceded by a "$" refer to the shell (command line), the rest which is preceded by a "/" is to be typed inside IRC clients. It is suggested you use between two clients: 4 * __Hexchat__: a GUI client, configuration is done by regular point ant click. 5 * __Irssi__: a more traditional unix client where interaction is done only by keyboard, great for people who enjoy scripting. 6 7 --- 8 9 ## TOC 10 1. [Step 1, Registration](#step-1-registration) 11 2. [Step 2, Configure your client](#step-2-configure-your-client) 12 2.1. [Option 1, SASL](#option-1-sasl) 13 2.2. [Option 2, CertFP](#option-2-certfp) 14 2.3. [Option 3, Use a free bouncer](#option-3-use-a-free-bouncer) 15 3. [Step 3, Set a ZNC bouncer](#step-3-set-a-znc-bouncer) 16 3.1. [Connect with CertFP](#connect-with-certfp) 17 3.2. [Modules](#modules) 18 4. [Step 4, Download files over IRC](#step-4-download-files-over-irc) 19 4.1. [With another person](#with-another-person) 20 4.2. [Using XDCC](#using-xdcc) 21 4.3. [Using fserve](#using-fserve) 22 5. [Step 5, Most used commands](#step-5-most-used-commands) 23 5.1. [Help commands](#help-commands) 24 5.2. [Network commands](#network-commands) 25 5.3. [Bouncer commands](#bouncer-commands) 26 5.4. [Channel commands](#channel-commands) 27 5.5. [Chat commands](#chat-commands) 28 5.6. [Filesharing commands](#filesharing-commands) 29 6. [Step 6, Netiquette](#step-6-netiquette) 30 31 --- 32 33 ## Step 1, Registration. 34 Optional, but in order to keep your nickname and have other options for concealing your host you have to register. Each example must be typed on your client. 35 1. Join a network: `/server -ssl <irc.network_name.net> 6697` 36 2. Pick a nickname that is free (you'll have your nick changed until you choose one free): `/nick <your_nickname>` 37 3. Request nickname registration (of your current nickname): `/msg NickServ REGISTER <your_password> <your@email.com>` 38 4. Check your e-mail and confirm. 39 4.1. On __Freenode__: `/msg NickServ VERIFY REGISTER <your_nickname> <confirmation_code_from_email>` 40 4.2. On __Rizon__: `/msg NickServ CONFIRM <confirmation_code_from_email>` 41 5. Hide your e-mail. 42 5.1. On __Freenode__: `/msg nickserv set hidemail on` 43 5.2. On __Rizon__: `/msg nickserv set hide email on` 44 6. Enable other concealment options. 45 6.1. On __Freenode__: 46 6.1.1. Check for available staff: `/stats p` 47 6.1.2. Message an available staff: `/msg <nickname_of_staff> Hello, may I have an unaffiliated cloak?` 48 6.1.3. Wait until they give you the cloak. 49 6.2. On __Rizon__: 50 6.2.1. Request a vHost (pick an appropriate vhost): `/msg HostServ REQUEST <vhost.goes.here>` 51 6.2.2. Wait until staff confirms. 52 6.2.3. When confirmed type: `/msg HostServ ON` 53 54 --- 55 56 ## Step 2, Configure your client 57 To connect using your nick you need to choose one of these options. 58 59 ### Option 1, SASL 60 1. On __Hexchat__: 61 1.1. Open the Network List (Ctrl + S) 62 1.2. Find each network to connect in the list then click on Edit to enter the Edit menu 63 1.3. On the Edit menu check "Use SSL..." and "Accept invalid SSL" 64 1.4. On the Edit menu uncheck the use of global user identification 65 1.5. On the Edit menu enter your nick in the Nick name and User name field 66 1.6. On the Edit menu select SASL (username + password) in the Login method field 67 1.7. On the Edit menu enter your password in the password field 68 2. On __irssi__: 69 2.1. Edit `~/.irssi/config` to change your nick and match the network nick to make auto registration. 70 2.2. Inside irssi type: 71 ``` 72 /server add -auto -net <network_name> -ssl -ssl_verify <irc.network_name.net> 6697 73 /network add -sasl_username <your_nickname> -sasl_password <your_password> -sasl_mechanism PLAIN <network_name> 74 /save 75 ``` 76 77 ### Option 2, CertFP 78 * Open a command line and type (you will be asked some questions, the importance of filling these correctly may vary): 79 ``` 80 $ openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes -keyout Certificate.key -out Certificate.crt 81 $ cat Certificate.crt Certificate.key > Certificate.pem 82 $ rm Certificate.crt Certificate.key 83 ``` 84 Before jumping to each client, note that for both clients the network and hostname should match (including the lower and uppercase) to what you already use. 85 1. On __HexChat__: 86 1.1. Rename the pem file to the network you wish (`<Network_name>.pem`) and move it to `~/.config/hexchat/certs/` 87 1.2. Open the Network List (Ctrl + S) 88 1.3. Find each network to connect in the list then click on Edit to enter the Edit menu 89 1.4. On the Edit menu select the boxes "Use SSL for all the servers on this network" and "Accept invalid SSL certificate" 90 1.5. On the Edit menu select SASL EXTERNAL (cert) in the Login method field 91 1.6. Connect to the network: `/server -ssl <network_name> 6697` 92 1.7. Login: `/msg NickServ IDENTIFY <your_password>` 93 1.8. Register your fingerprint (append FINGERPRINT if on Rizon): `/msg NickServ cert add` 94 2. On __irssi__: 95 2.1. Rename the pem file to the network you wish (`<network_name>.pem`) and move it to `~/.irssi/certs/` 96 2.2. Edit `~/.irssi/config` to change your nick and match the network nick to make auto registration 97 2.3. Remove the server (make sure to remove all instances): `/server remove <irc.network_name.net>` 98 2.4. Add it again with the SSL flag: `/server add -ssl -ssl_cert ~/.irssi/certs/<network_name>.pem -network <network_name> <irc.network_name.net> 6697` 99 2.5. Connect to the network (do not /reconnect): `/connect <network_name>` 100 2.6. Login: `/msg NickServ IDENTIFY <your_password>` 101 2.7. Register your fingerprint (use "`/msg NickServ access`" if on Rizon): `/msg NickServ cert add` 102 2.8. Save changes: `/save` 103 104 ### Option 3, Use a free bouncer 105 Choose a network address (`<irc.network_name.net>`) from http://wiki.znc.in/Providers, and use steps provided by the service. After you sign to a bouncer configure your client. 106 1. On __Hexchat__: 107 1.1. Open the Network List (Ctrl + S) 108 1.2. Create a new network in the list then click on Edit to enter the Edit menu 109 1.3. On the servers list add the BOUNCER address followed by the port: `<BOUNCER_address>/<BOUNCER_port_number>` 110 1.4. On the Edit menu check "Use SSL..." and "Accept invalid SSL" 111 1.5. On the Edit menu uncheck the use of global user identification 112 1.6. On the Edit menu enter `<BOUNCER_username>/<network_name>` in the User name field 113 1.7. On the Edit menu select SASL (username + password) in the Login method field 114 1.8. On the Edit menu enter your `<BOUNCER_password>` in the password field 115 2. On __irssi__: 116 2.1. Add the BOUNCER name to your client: `/network add <BOUNCER_name>` 117 2.2. Add the BOUNCER server: `/server add -net <BOUNCER_name> -ssl <BOUNCER_address> <BOUNCER_port_number> <BOUNCER_username>:<BOUNCER_password>` 118 2.3. Save changes: `/save` 119 2.4. Connect to the BOUNCER: `/connect <BOUNCER_name>` 120 2.5. Login as you normally would. 121 122 --- 123 124 ## Step 3, Set a ZNC bouncer 125 ZNC is a bouncer which means if you have a home server or a VPS you can have your own bouncer to keep track of the conversation and for a few more options. During the configuration wizard of ZNC you are prompt to some options, if is not mentioned here is safe to leave blank except for the modules so first check the modules you want. If you want a web interface to control ZNC on global modules choose the "webadmin" option. 126 1. Make sure you have `libicu-dev` for unicode characters and `libssl-dev` for SSL support (optional): `$ sudo <package_manager_installation_command> libicu-dev libssl-dev` 127 2. Create a user for ZNC: `$ sudo adduser znc` 128 3. Switch to that user: `$ su znc` 129 4. Change to the user's home directory: `$ cd ~` 130 5. Install ZNC on your server. You can install like any other application, but an EXTRA OPTIONAL manual installation from source is here described: 131 5.1. Download: `$ wget -c http://znc.in/releases/znc-latest.tar.gz` 132 5.2. Untar: `$ tar -xzvf znc-latest.tar.gz` 133 5.3. Change to the unziped directory: `$ cd znc-<version>` 134 5.4. Configure installation and path (choose whatever but preferably use "`$HOME/.bin`"): `$ ./configure --prefix="</path/to/znc/program>"` 135 5.5. Make: `$ make` 136 5.6. Install: `$ make install` 137 6. Change back to znc home direcoty: `$ cd ~` 138 7. Remove files you don't need: `$ rm -r znc-*` 139 8. Change to where znc is installed: `$ cd </path/to/znc/program>` 140 9. Launch the configuration wizard: `$ ./znc --makeconf` 141 10. Add a port to run ZNC on (don't run in anything less than 1024): `<znc_port_number>` 142 11. If you know you have openssl choose to connect with SSL to your server (you need this for certauth). 143 12. Choose if you want to connect with ipv6 to your server (if you know your server supports it, otherwise choose "no"). 144 13. Add a user name for login to ZNC: `<znc_username>` 145 14. Add a password for that login: `<znc_password>` 146 15. Choose if you want that login be an administrator of ZNC. 147 16. Add your IRC username: `<your_nickname>` 148 17. When asks to setup a new server choose "yes". 149 18. Add IRC server address: `<irc.network_name.net>` 150 19. Add a port to connect to the network, should be 6697 unless otherwise specified. 151 20. If you want to tunnel through Tor use proxychains (optional): 152 20.1. Install Tor and proxychains: `$ sudo <package_manager_installation_command> proxychains tor` 153 20.2. Get ZNC process ID: `$ pkill znc` 154 20.3. Start Tor (is recommended to run inside GNU Screen): `$ tor` 155 20.4. Start ZNC under proxychains: `$ proxychains </path/to/znc/program>/znc` 156 21. When done with the configuration exit the znc user just by pressing CTRL-d does the trick or you can type "exit". 157 22. While still on the server add a cron job to autostart ZNC (if these don't work you are not using vixie cron). 158 22.1. Start the cron daemon: 159 22.1.1. With System V: `$ sudo update-rc.d cron enable` 160 22.1.2. With systemd: `$ sudo systemctl enable cron.service` 161 22.2. Add a cron job: `$ sudo crontab -e -u znc` 162 22.3. Add the lines (if you DIDN'T do the manual install the location should be "`/usr/local/bin/znc`"): `@reboot </path/to/znc/program> >/dev/null 2>&1` 163 22.4. If you use ZNC only in your local network add these lines too to set a tight firewall: 164 ``` 165 $ sudo iptables -I INPUT -p tcp --dport <znc_port_number> -s 192.168.18.0/24 -j ACCEPT 166 $ sudo iptables -A INPUT -p tcp --dport <znc_port_number> -j DROP 167 ``` 168 23. Configure authentication of the irc client you use on your computer: 169 23.1. On __Hexchat__: 170 23.1.1. Open the Network List (Ctrl + S) 171 23.1.2. Create a new network in the list then click on Edit to enter the Edit menu 172 23.1.3. On the servers list add you ZNC server address followed by the port: `<znc_server_ip>/<znc_port_number>` 173 23.1.4. On the Edit menu check "Use SSL..." and "Accept invalid SSL" 174 23.1.5. On the Edit menu uncheck the use of global user identification 175 23.1.6. On the Edit menu enter `<znc_username>/<network_name>` in the User name field 176 23.1.7. On the Edit menu select SASL (username + password) in the Login method field 177 23.1.8. On the Edit menu enter your `<znc_password>` in the password field 178 23.2. On __irssi__: 179 23.2.1. Remove the server (make sure to remove all instances): `/server remove <irc.network_name.net>` 180 23.2.2. Add the ZNC server in its place. NOTE: You can use another name for the network and leave the normal name to connect directly without the bouncer such as znc_network_name: 181 ``` 182 /network add <znc_network_name> 183 /server add -net <znc_network_name> -ssl <znc_server_ip> <znc_port_number> <znc_username>/<network_name>:<znc_password> 184 /save 185 ``` 186 23.2.3. Connect to ZNC pointing to the network: `/connect <znc_network_name>` 187 23.2.4. Login as you normally would for each network you want ZNC to stay connected: `/msg NickServ IDENTIFY <your_password>` 188 189 ### Connect with CertFP 190 OPTIONAL but ADVISED as it will hide your password on your network. 191 1. Load the certauth module: `/msg *status LoadMod certauth` 192 2. Copy your pem file to the server running ZNC and to `/home/znc/.znc/users/<znc_username>/networks/<network_name>/moddata/cert/user.pem`. 193 3. Add your fingerprint to the ZNC server: `/msg *certauth add` 194 4. Restart the ZNC server: `/msg *status Restart` 195 5. Configure your client. 196 5.1. On __HexChat__: 197 5.1.1. Rename the pem file to the network you wish (`<znc_network_name>.pem`) and move it to `~/.config/hexchat/certs/`. 198 5.1.2. Open the Network List (Ctrl + S). 199 5.1.3. Create a new network in the list then click on Edit to enter the Edit menu. 200 5.1.4. On the servers list add you ZNC server address followed by the port: `<znc_server_ip>/<znc_port_number>` 201 5.1.5. On the Edit menu select the boxes "Use SSL for all the servers on this network" and "Accept invalid SSL certificate". 202 5.1.6. On the Edit menu uncheck the use of global user identification. 203 5.1.7. On the Edit menu enter `<znc_username>/<network_name>` in the User name field. 204 5.1.8. On the Edit menu select SASL EXTERNAL (cert) in the Login method field. 205 5.1.9. On the Edit menu enter your `<znc_password>` in the password field. 206 5.1.10. Connect to ZNC pointing to the network: `/server -ssl <znc_network_name> <znc_port_number>` 207 5.2. On __irssi__: 208 5.2.1. Remove the server (make sure to remove all instances): `/server remove <znc_server_ip>` 209 5.2.2. Add the server pointing to the pem file and without the password: 210 ``` 211 /server add -ssl -ssl_cert ~/.irssi/certs/<znc_network_name>.pem -net <znc_network_name> <znc_server_ip> <znc_port_number> <znc_username>/<network_name>: 212 /save 213 ``` 214 5.2.3. Connect to ZNC pointing to the network: `/connect <znc_network_name>` 215 6. Confirm fingerprint for each network (requires "cert" module loaded). 216 6.1. Login: `/msg NickServ IDENTIFY <your_password>` 217 6.2. __FREENODE__ 218 6.2.1. To look for you fingerprint on FREENODE: `/msg NickServ cert list` 219 6.2.2. Connect to FREENODE: `/msg NickServ cert add <fingerprint>` 220 6.3. __RIZON__ 221 6.3.1. To look for you fingerprint on RIZON: `/msg NickServ access list` 222 6.3.2. Connect to RIZON: `/msg NickServ access add fingerprint <fingerprint>` 223 7. From now on just connect to ZNC pointing to the network: `/connect <znc_network_name>` 224 225 ### Modules 226 Some modules are required for further options. 227 * To list all available modules: `/msg *status ListAvailMods` 228 * To load modules: `/msg *status LoadMod <znc_module_name>` 229 Some modules you may want are: 230 * "chansaver": ZNC config up to date with channels you parted/joined so that you don't have to add them manually. 231 * "dcc" and "bouncedcc": transfer files to and from ZNC, while using ZNC as a middle man. 232 * "controlpanel": edit ZNC configuration through your IRC client. 233 * "perform": keep a list of commands to be executed. 234 * "sasl": authenticate to an IRC network with SASL, you will also need this for authenticating with a certificate. 235 * "cert": authenticate to an IRC network with a certificate. 236 * "certauth": required to use a certificate and hide your password from plain files. 237 238 --- 239 240 ## Step 4, Download files over IRC 241 Certain channels have bots or fservers. IRC indexers are websites providing the channel name, bot/fserver name, and files available. Search on XDCC search engines and indexers for channels, available files and bots/fservers providing them. You can find some indexers https://en.wikibooks.org/wiki/Downloading_Files_from_IRC/XDCC_Bot_Guide#XDCC_Search_Engines. 242 243 ### With another person 244 1. Make sure to start the DCC server: `/dcc server` 245 2. Ask politely if you can share a file with that person. 246 3. Send files to that person: `/DCC send <someone's_nickname> </path/to/file>` 247 4. Or accept files: `/DCC get <someone's_nickname>` 248 249 ### Using XDCC 250 1. List bot contents: `/msg <bot_name> XDCC LIST` 251 _If the previous displays a warning with a website you have to go to that website to get listings, or if it shows a command you need to type that command._ 252 2. To show available bot commands: `/msg <bot_name> XDCC HELP` 253 3. To search for inside the bot's contents: `/msg <bot_name> XDCC SEARCH <anything_goes_here>` 254 4. To display information on the file: `/msg <bot_name> XDCC INFO <file>` 255 5. To download a file (can use GET instead of SEND): `/msg <bot_name> XDCC SEND <file>` 256 6. To download a file with a password (can use GET instead of SEND): `/msg <bot_name> XDCC SEND <file> <password>` 257 7. To cancel current download: `/msg <bot_name> XDCC CANCEL` 258 8. To download all files matching `<file_pattern>`: `/msg <bot_name> XDCC BATCH <file_pattern>` 259 9. To download all files with a password matching `<file_pattern>`: `/msg <bot_name> XDCC BATCH <file_pattern> <password>` 260 10. To download all files matching between `<file_pattern1>` and `<file_pattern3>`: `/msg <bot_name> XDCC BATCH <file_pattern1>-<file_pattern3>` 261 11. To download all files with a password matching between `<file_pattern1>` and `<file_pattern3>`: `/msg <bot_name> XDCC BATCH <file_pattern1>-<file_pattern3> <password>` 262 12. To remove a download from queue (if `<file>` is not given it will remove all): `/msg <bot_name> XDCC REMOVE <file>` 263 13. To show download queue and estimated download time: `/msg <bot_name> XDCC QUEUE` 264 265 ### Using fserve 266 1. To request a file if you already know the name and location: `/dcc get <fserve_name> <folder/><file>` 267 2. To connect to a bot and browse its file collection: `/ctcp <fserve_name> collection <number>` 268 3. On the bot chat use different keywords for specific tasks, "`dir`" will list of all files and sub-directories, "`cd <directory>`" will change to desired directory (with "`cd ..`" changing to upper folder), "`get <file>`" will request a file, and "`exit`" will disconnect from bot chat. 269 4. If the server displays numbers followed with letters then you can instead type those to enter folders or download files (e. "`1d`"): `<number><letter>` 270 271 --- 272 273 ## Step 5, Most used commands 274 Anything that starts with a forward slash is an IRC client command. To login you need to either type these each time or configure your client to do it for you. To connect on Hexchat you can go to network list. Whenever you enter IRC you connect to a network but you are not immediately connected to a channel. 275 276 ### Help commands 277 * To see the help from your IRC client (`<some_command>` is optional): `/help <some_command>` 278 * To see network specific help (while in that network's window -`<some_command>` is optional-): `/msg NickServ help <some_command>` 279 280 ### Network commands 281 * To join a network: `/server -ssl <irc.network_name.net> 6697` 282 * To join a network (after you set your client): `/server <network_name>` 283 * To join a network without leaving the current network (on irssi): `/connect <network_name>` 284 * To quit a network (while in a window from that network): `/discon` 285 * To login with your nickname (if you didn't set your client): `/msg NickServ IDENTIFY <your_password>` 286 287 ### Bouncer commands 288 * To join the BOUNCER server (if you didn't set not your client): `/server -ssl <BOUNCER_address> <BOUNCER_port_number> <BOUNCER_username>:<BOUNCER_password>` 289 * To join the BOUNCER server (if you set your client): `/connect <BOUNCER_name>` 290 * To join the ZNC server (if you set ZNC but not your client): `/server -ssl <znc_server_ip> <znc_port_number> <znc_username>:<znc_password>` 291 * To join the ZNC server (if you set ZNC and certauth, but not your client): `/server -ssl <znc_server_ip> <znc_port_number> <znc_username>:` 292 * To join the ZNC server (if you set ZNC and your client): `/connect <znc_network_name>` 293 294 ### Channel commands 295 * To search for channels: `/list *<pattern>*` 296 * To search for channels (on __Freenode__): `/msg alis LIST *<pattern>*` 297 * To join a channel: `/join #<some_channel>` 298 * To quit a channel (when you are in that channel): `/part` 299 * To change the channel's topic: `/msg ChanServ TOPIC #<some_channel> <topic_goes_here>` 300 301 ### Chat commands 302 * To describe yourself in third person (mostly describing an action): `/me <does_something>` 303 * To send a message to a single individual: `/msg <someone's_nickname> <some_message>` 304 * To open a chat window with a single individual: `/query <someone's_nickname>` 305 * To close a chat window of a single individual (in the window of that individual): `/q` 306 307 ### Filesharing commands 308 * To send files to someone: `/DCC send <someone's_nickname> </path/to/file>` 309 * To accept files from someone: `/DCC get <someone's_nickname>` 310 * To start the DCC server: `/dcc server` 311 * To close the DCC server: `/dcc close server <port>` 312 * To list all bots and fservers on the current channel: `!list` 313 * To search for any number of files on any number of bots or fservers on the current channel: `@find <anything_goes_here>` 314 * To add a bot/fserve/nick to whitelist: `/set dcc_autoget_masks <bot/fserve/nick_name>` 315 * To set to accept everything (not advised): `/set dcc_autoget` 316 317 --- 318 319 ## Step 6, Netiquette 320 Netiquette refers to etiquete on IRC. 321 * Always check the topic on each channel. 322 * Familiarize with jargon. Although not all communities make use of abbreviations, strange terminology and inside jokes, some IRC users sometimes makes heavy use, learn them. Be careful not to be in a community were your own is misunderstood. Make sure to check twice what it means for that specific community. 323 * Don't abuse capslock. Entire words in capslock is like yelling, try to limit or straight eliminating its use. 324 * Make questions the smart way. Be polite if you want to ask for something, also be precise, concise and informative, and have patience. 325 * Lurk! You see people join an IRC channel, say something, and then leave 2 minutes later because they haven't been replied to yet. The speed of IRC conversations can be realtime, but sometimes can also be much slower than that. You should be willing to leave your IRC program running 24/7 so you can participate in longer-timescale conversations. This is also the best way to guarantee that you get questions answered. 326