Firefox Telnet Handler

Firefox by default doesn’t have a telnet handler. This is quite annoying because it means that whenever you click on a telnet link you will get the following message:

"Firefox doesn't know how to open this address, because the protocol (telnet) isn't associated with any program."

As a network engineer you probably use telnet every now and then so it would be nice if these links are clickable so you don’t have to copy and paste them in your terminal.

In order to fix this, we’ll create a script that launches telnet and connects to the IP address or hostname that you clicked on in the browser and we will tell firefox to use this script.

I will create a new folder in my home folder where I’ll store the script:

# mkdir ~/scripts

We’ll create a new filename for the script:

# vim ~/scripts/

Paste the following into the VIM text editor:


#makes -i $HOME/.ssh/id_rsa_foo work
data=${data//\%20/ }
#/makes -i $HOME/.ssh/id_rsa_foo work

/usr/bin/mate-terminal -e "$proto $data"

In my case I’m using mate-terminal (the default terminal for Linux Mint) but you can change this line if you are using the Gnome terminal or something else like xterm. Save it and make it executable:

# chmod +x

This script requires the ZSH shell so if you don’t have it, install it:

# sudo apt-get install zsh

The script is ready but we still need to make some changes to firefox. Start firefox and type about:config in the address bar.

Click on “I’ll be careful, I promise!”. Do a right mouse click, select New and choose for Boolean.

Call the new entry “network.protocol-handler.expose.telnet” (without quotes) , select False and click on OK.

Restart firefox and open a webpage that shows you some telnet links. For example the looking glass servers webpage. Click on a telnet link and firefox will ask you what application to use. Click on Browse and select the script file that you just created.

If everything went ok, it should now open a terminal and telnet to the correct hostname / IP address!

Thanks to Jonathan Ernst for providing this script.

Tags: ,

Forum Replies

  1. Great tutorial, Rene.

    Is it possible to do with linux/chrome as well? Not sure what you do for network.protocol-handler.expose.telnet in chrome.

    merci d’avance

  2. Hi Chris,

    It should be possible but I haven’t tried it yet…when I have some time I’ll give it a shot.


Ask a question or join the discussion by visiting our Community Forum