IRC: ZNC with Irssi and tmux Configuration: Difference between revisions
From falz.net
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
=== Configuration === | === Configuration === | ||
Ubuntu / Debian example. Install some packages: | Ubuntu / Debian example. Install some packages: | ||
apt-get install mosh irssi znc tmux | apt-get install mosh irssi znc tmux | ||
====ZNC==== | ====ZNC==== | ||
Line 37: | Line 40: | ||
znc --makeconf | znc --makeconf | ||
* Listen on port: '''6667''' | * Listen on port: '''6667''' | ||
Line 42: | Line 46: | ||
* Username: '''myzncuser''' | * Username: '''myzncuser''' | ||
* Password: '''<redacted>''' | * Password: '''<redacted>''' | ||
* ''many other questions'': '''<chose defaults''' | * ''many other questions'': '''<chose defaults>''' | ||
* Set up a network? '''No''' | * Set up a network? '''No''' | ||
* Launch ZNC now? '''No''' | * Launch ZNC now? '''No''' | ||
* Edit the newly created znc.conf and tell it to bind to localhost | * Edit the newly created znc.conf and tell it to bind to localhost by adding <code>Host = 127.0.0.1</code> to the <code><Listener l></code> section | ||
* Copy your newly created config to the ZNC service directory and fix its permissions. The directory <code>/var/lib/znc/</code> should already exist, "'''_znc'''" is the default user for the service which should already exist. | <Listener l> | ||
... | |||
Host = 127.0.0.1 | |||
.... | |||
</Lisner> | |||
* Copy your newly created config (and a crt required for startup) to the ZNC service directory and fix its permissions. The directory <code>/var/lib/znc/</code> should already exist, "'''_znc'''" is the default user for the service which should already exist. | |||
sudo mkdir /var/lib/znc/configs/ | sudo mkdir /var/lib/znc/configs/ | ||
sudo cp ~/.znc/configs/znc.conf /var/lib/znc/configs/ | sudo cp ~/.znc/configs/znc.conf /var/lib/znc/configs/ | ||
sudo cp ~/.znc/znc.pem /var/lib/znc/ | |||
sudo chown -R _znc:_znc /var/lib/znc/ | sudo chown -R _znc:_znc /var/lib/znc/ | ||
* Enable and start the service | |||
* Enable and start the service (as root user / sudo) | |||
systemctl enable znc | systemctl enable znc | ||
systemctl start znc | systemctl start znc | ||
Line 74: | Line 88: | ||
* Add network called 'libera-znc'. | * Add network called 'libera-znc'. | ||
/network add libera-znc -nick myircuser -alternate_nick myircuser_ -user -autosendcmd '^MSG NickServ identify <ircpass>' myzncuser-libera | /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 | * Add a server to this newly created network | ||
/server add -network libera-znc -auto -4 localhost 6667 myzncuser-libera/libera:<zncpass> | /server add -network libera-znc -auto -4 localhost 6667 myzncuser-libera/libera:<zncpass> |
Revision as of 12:34, 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 by adding
Host = 127.0.0.1
to the<Listener l>
section
<Listener l> ... Host = 127.0.0.1 .... </Lisner>
- Copy your newly created config (and a crt required for startup) to the ZNC service directory and fix its permissions. The directory
/var/lib/znc/
should already exist, "_znc" is the default user for the service which should already exist.
sudo mkdir /var/lib/znc/configs/ sudo cp ~/.znc/configs/znc.conf /var/lib/znc/configs/ sudo cp ~/.znc/znc.pem /var/lib/znc/ sudo chown -R _znc:_znc /var/lib/znc/
- Enable and start the service (as root user / sudo)
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>