SSH and telnet protocol handler for Firefox
I manage quite a lot of different computers, network devices, etc. As we are using an internal web based documentation system I thought it would be useful to be able to just click on ssh://user@thiscomputer.com and telnet://thisdevice.com links and have Firefox open a terminal where I’d be connected to this specific machine.
As with most things computer related in the Internet era, someone else had already just done that. I modified his script a little bit so it’ll work with links specifying ssh keys and port :
- save the following zsh script into a file (let’s call it ~/.scripts/firefox-handler.zsh) (if you don’t have zsh, install it using your package manager or fix the script to use whatever shell you want).
#!/bin/zsh url=$1 proto=${url//:*/} data=${${url//*:\/\//}%/} #makes -i $HOME/.ssh/id_rsa_foo work data=${data//\%20/ } data=${data//\$HOME/$HOME} #/makes -i $HOME/.ssh/id_rsa_foo work /usr/bin/gnome-terminal -e "$proto $data" - chmod +x ~/.scripts/firefox-handler.zsh
- in Firefox go to about:config and add the following two strings (right-click -> new -> string) network.protocol-handler.app.ssh and network.protocol-handler.app.telnet and put nothing as the value (for a yet unknown reason, it doesn’t work if you specify the path to your script right now)
Restart Firefox, you should now be able to click on ssh and telnet links and also type those URIs in your location bar and it should ask you with what application you want to open it, you can now browse to the location of the previously created script and check the box « don’t ask me again ». As an added bonus, you can also use those URIs as bookmarks which I find quite handy.
Tags: firefox, linux, mozilla, script, ssh, telnet, tips, ubuntu

31 octobre 2008 à 13:36
Perhaps you could try to get this into Ubuntu? I think it would be a nice standard feature to have.
reply/répondre
jernst Reply:
octobre 31st, 2008 at 15:10
@Craig, that’s the purpose of this bug : LP: #3554
reply/répondre
31 octobre 2008 à 15:32
Or you can install the Mozilla plugin mozilla-plugin-pcmanx which does essentially the same thing for telnet:// URIs. I am not aware of a Ubuntu package that will do the same for ssh:// (unless you’re using KDE, in which case Konqueror fits the bill). It may be worth having the dev(s) for the pcmanx project add SSH functionality.
reply/répondre
12 novembre 2008 à 20:00
[...] SSH and telnet protocol handler for Firefox [...]
14 novembre 2008 à 12:52
[...] bzw. welches Programm sie starten sollen. Bei Firefox kann das direkt about about:config geschehen: SSH and telnet protocol handler for Firefox | Jonathan Ernst Unter Windows kann man das auch in der registry eintragen. Sowohl der IE als auch Firefox [...]