4

I'm using IRSSI and I wonder how can I pass my IRC channel's passwords to the IRSSI config file (~/.irssi/config) without writing them directly in the file.

In Mutt I've an awk command that queries a local file in my encrypted home folder, something like this:

set my_pass1=`awk '/fradeve_gmail:/ {print $2}' ~/.mutt/muttpass`
set my_pass2=`awk '/fradeve_inventati:/ {print $2}' ~/.mutt/muttpass`

Is there a similar solution for IRSSI?

PS: obviously I don't want to keep the IRSSI config file in my encrypted home :)

2
  • You could keep your irssi config in the same encrypted location. Jan 9, 2012 at 18:05
  • Why do you "obviously" not want to store the irssi config in the encrypted space? You could symlink it to the irssi config directory. Apr 17, 2012 at 7:55

3 Answers 3

0

Depending how you store your passwords? If you just have them in the autosendcmd, you could do the same trick you do with awk.

See http://irssi.org/beginner/#c3 for an example:

/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
2
  • could you expand your answer a little bit more?, I've not find a way to do it with autosendcmd =/ Jun 2, 2013 at 5:31
  • See edit - does that help?
    – zigdon
    Jun 8, 2013 at 8:29
0

I was trying to solve the exact same problem - it seems you can't easily pass bash variables to the irssi config. Storing passwords in plaintext files or environment variables wouldn't be a good idea in the first place.

In case you are connecting to freenode you could use either SASL or CERTFP.
Here's a tutorial that shows how to set up SASL (scroll down to the scripts section).

0

On servers that use NickServ or another Bot which you need to message to identify yourself you can use the following:

  1. Create a shell script that outputs the message you need to send to the bot, save it to your irssi config folder and make it executable. In the case of NickServ:
    echo "IDENTIFY $(command that returns nick) $(command that returns password)"
  1. Enter the following on your autosendcmd for your connection substituting script-name by the name of the script you saved previously:
    /EXEC - -msg NickServ ./script_name

When you connect to the server the autosendcmd will execute your shell script and send its output as a message to NickServ.

I'm using a Mac so my nick and password are encrypted and saved on my keychain. The command I use to retrieve them are:

  • Nick:
/usr/bin/security find-generic-password -l <keychain_password_name> | grep acct | cut -d '"' -f 4
  • Password:
/usr/bin/security find-generic-password -wl <keychain_password_name>

This way there won't be any plain text passwords on your irssi config file.

You must log in to answer this question.