IRC: ZNC with Irssi and tmux Configuration: Difference between revisions
From falz.net
Created page with "'''Work in progress''' === Description === This is for folks generally proficient at a unix terminal. It is so that you can connect to a terminal via ssh and reconnect to your IRC session without actually 'leaving' any IRC networks. You will always appear online to those on the IRC network, and can choose to look at / log into your terminal when you desire. This example connects to the libera IRC network. === Applications === * [https://irssi.org/ irssi] - An IRC cli..." |
No edit summary |
||
Line 6: | Line 6: | ||
You will always appear online to those on the IRC network, and can choose to look at / log into your terminal when you desire. | You will always appear online to those on the IRC network, and can choose to look at / log into your terminal when you desire. | ||
This example connects to the libera IRC network. | This example connects to the libera IRC network. Replace this part and repeat various steps to connect to other networks. | ||
=== Applications === | === Applications === | ||
Line 23: | Line 23: | ||
====ZNC==== | ====ZNC==== | ||
* | We are NOT using SSL here as we are binding to localhost only and connecting from localhost only. This is the communication from the IRC client to the IRC bounce. | ||
Getting ZNC and irssi working with ssl and a local cert is a large pain in the butt. | |||
When you connect to an irc network you should use SSL. | |||
* Docs | |||
** https://wiki.znc.in/Configuration | |||
* Generate an initial config. Run this as your own user (not root) This will place it in <code>~/.znc/configs/znc.conf</code>. We will be copying this file to the service user's account after. | |||
znc --makeconf | |||
* Listen on port: '''6667''' | |||
* SSL: '''No''' | |||
* Username: '''myzncuser''' | |||
* Password: '''<redacted>''' | |||
* ''many other questions'': '''<chose defaults''' | |||
* Set up a network? '''No''' | |||
* Launch ZNC now? '''No''' | |||
* Edit the newly created znc.conf and tell it to bind to localhost - add this to the top in the main section (not nested in any <section>) | |||
BindHost = 127.0.0.1 | |||
* Copy your newly created config to the ZNC service directory and fix its permissions - "'''_znc'''" is the default user for the service which should already exist. | |||
sudo mkdir -p /var/lib/znc/configs/ | |||
sudo cp ~/.znc/configs/znc.conf /var/lib/znc/ | |||
sudo chown -R _znc:_znc /var/lib/znc/ | |||
* Enable and start the service | |||
systemctl enable znc | |||
systemctl start znc | |||
systemctl status znc | |||
====irssi==== | ====irssi==== | ||
* Docs | |||
** https://irssi.org/documentation/help/network/ | |||
** https://irssi.org/documentation/help/server/ | |||
launch <code>irssi</code> and issue some commands | launch <code>irssi</code> and issue some commands | ||
Revision as of 11:04, 30 May 2025
Work in progress
Description
This is for folks generally proficient at a unix terminal. It is so that you can connect to a terminal via ssh and reconnect to your IRC session without actually 'leaving' any IRC networks.
You will always appear online to those on the IRC network, and can choose to look at / log into your terminal when you desire.
This example connects to the libera IRC network. Replace this part and repeat various steps to connect to other networks.
Applications
- irssi - An IRC client that runs in a terminal. It will connect to ZNC in this use case.
- ZNC - IRC "bouncer". This actually connects to IRC networks and will run as a service on your server.
- Tmux - Terminal Multiplexer. This lets you run many applications in one terminal. In this use case we'll run many irssi IRC clients, each of which connects to a ZNC session and hence a single IRC network
- Mosh - Mobile Shell. Auto 'roams' and reconnects to your shell session across various networks. If your laptop goes to sleep and wakes up, it will reconnect.
Configuration
Ubuntu / Debian example. Install some packages:
apt-get install mosh irssi znc tmux
ZNC
We are NOT using SSL here as we are binding to localhost only and connecting from localhost only. This is the communication from the IRC client to the IRC bounce.
Getting ZNC and irssi working with ssl and a local cert is a large pain in the butt.
When you connect to an irc network you should use SSL.
- Generate an initial config. Run this as your own user (not root) This will place it in
~/.znc/configs/znc.conf
. We will be copying this file to the service user's account after.
znc --makeconf
- Listen on port: 6667
- SSL: No
- Username: myzncuser
- Password: <redacted>
- many other questions: <chose defaults
- Set up a network? No
- Launch ZNC now? No
- Edit the newly created znc.conf and tell it to bind to localhost - add this to the top in the main section (not nested in any <section>)
BindHost = 127.0.0.1
- Copy your newly created config to the ZNC service directory and fix its permissions - "_znc" is the default user for the service which should already exist.
sudo mkdir -p /var/lib/znc/configs/ sudo cp ~/.znc/configs/znc.conf /var/lib/znc/ sudo chown -R _znc:_znc /var/lib/znc/
- Enable and start the service
systemctl enable znc systemctl start znc systemctl status znc
irssi
launch irssi
and issue some commands
- Add network called 'libera-znc'.
/network add libera-znc -nick myircuser -alternate_nick myircuser_ -user -autosendcmd '^MSG NickServ identify <ircpass>' myzncuser-libera
- Add a server to this newly created network
/server add -network libera-znc -auto -4 localhost 6667 myzncuser-libera/libera:<zncpass>