Skip to Content

Slack IRC Gateway Authentication with irssi

Slack IRC Gateway Authentication with irssi

Slack’s web interface isn’t too shabby, but at times it’s more preferable and easier to instead have a command line alternative.

Also when working on a server or command line orientated environment, you might not have access to a web browser to login to Slack.

So running an IRC client with access to the gateway provided, is the supported solution and remedy for this. The rest of this post shows one relatively straight forward way of using irssi IRC chat client to connect and authenticate with the gateway.

Read this: Installing Fail2ban on Ubuntu 18.04 (Bionic Beaver)


1 – Enable IRC on Slack Team

In the Slack team’s web browser session navigate to:

Team settings > Permissions > Gateways > Expand

Tick “Enable IRC gateway (SSL only)” and then click Save Settings.

slack gateways

XMPP as pictured can also be enabled here for services such as Jabber


2 – Install irssi

Arch Linux

The simplest most accessible way is by using the system’s package manager:

[alert-announce]

  1. $ sudo pacman -S irssi

[/alert-announce]

Debian / Ubuntu

The simplest most accessible way is by using the system’s package manager:

[alert-announce]

  1. $ sudo apt-get install irssi

[/alert-announce]

3 – Run irssi

Here are two methods, either on its own:

[alert-announce]

  1. $ irssi

[/alert-announce]

Or in a screen session:

[alert-announce]

  1. $ screen -S irssi-irc-client irssi

[/alert-announce]

4 – Slack Team Gateway Credentials

Navigate to the new page that contains your team’s Slack gateway credentials.

Account & Profile > Settings tab > Gateways > Gateway configuration
Here are the details you need for the next few steps in order to setup IRC authentication to the Slack team.

slack irc

Refer back to them as needed for these next steps.


5 – Add Slack Network Details

Where <slack-username> is your Slack username, and loy-slack is the name you want the network to be remembered as.

[alert-announce]

  1. /network add -nick <slack-username> loy-slack

[/alert-announce]

6 – Add Slack Server Details

Now add the server details to the network defined in the previous step, the command to do this comes next. Remember to replace loy-slack with the name you gave the network, and substitute the details from your Slack team’s IRC credentials into the command.

[alert-announce]

  1. /server add -auto -ssl -network loy-slack <slack-teamname>.irc.slack.com 6667 <slack-password>

[/alert-announce]

7 – Save Default Slack Channels

Entering this command will ensure irssi always joins the channel and network name whenever you connect to the server:

[alert-announce]

  1. /channel add -auto #general loy-slack

[/alert-announce]

8 – Save Configuration

Save all changes to the irssi configuration file in your user’s Linux home directory.

[alert-announce]

  1. /save

[/alert-announce]

Then quit the program:

[alert-announce]

  1. /quit

[/alert-announce]

9 – Run irssi

Once again run the program as down in the earlier step:

[alert-announce]

  1. $ irssi

[/alert-announce]

Or in a screen session:

[alert-announce]

  1. $ screen -S irssi-irc-client irssi

[/alert-announce]

The below output or similar appears upon launch of irssi:

[alert-announce]

  1. 3:43 -!- Irssi: Looking up <slack-teamname>.irc.slack.com
  2. 13:43 -!- Irssi: Connecting to <slack-teamname>.irc.slack.com [52.6.30.134] port 6667
  3. 13:43 -!- Irssi: Connection to <slack-teamname>.irc.slack.com established
  4. 13:43 slackbot [] requested CTCP VERSION from <user-name>:
  5. 13:43 -!- IRC-SLACK gateway
  6. 13:43 -!- Welcome to Slack IRC Gateway server <user-name>!~<user-name>@10.0.23.98
  7. 13:43 -!- MAP SILENCE=15 WHOX WALLCHOPS WALLVOICES USERIP CPRIVMSG CNOTICE MODES=6 MAXCHANNELS=100 SAFELIST are supported by this server
  8. 13:43 -!- NICKLEN=32 TOPICLEN=160 AWAYLEN=160 CHANTYPES=# PREFIX=(ov)@+ CHANMODES=b,k,l,rimnpst CASEMAPPING=rfc1459 are supported by this server
  9. 13:43 -!- there are 11 users
  10. 13:43 -!- Message of the day
  11. 13:43 -!- WELCOME TO SLACK…
  12. 13:43 -!- End of MOTD command
  13. 13:43 -!- Mode change [] for user <user-name>:+i

[/alert-announce]

The persistent Slack connection is now setup and will be active each time you run irssi.