ssh:// protocol handler

I finally broke down and configured an ssh:// protocol handler so that I could create ssh:// links in web pages that open my ssh client, much like mailto:// opens my MUA

Below is how I did this on Ubuntu Linux running Xfce.

  1. Register the x-scheme-handler/ssh with xdg-mime.

    xdg-mime default ssh.desktop x-scheme-handler/ssh
  2. Create the ~/.local/share/applications/ssh.desktop launcher.

    [Desktop Entry]
    Version=1.0
    Name=SSH Launcher
    Exec=xterm -e '(URL="%U"; ssh ${URL##*/}) || bash'
    Type=Application
    Terminal=false
    Icon=utilities-terminal
  3. Reconfigure the GVFS daemon to not intercept ssh:// URIs by commenting out (#) the SchemeAliases=ssh line.

    sudoedit /usr/share/gvfs/mounts/sftp.mount
  4. HUP the gvfsd process (running as your user).
  5. The following command should open an XTerm that launches an ssh to hostname.

    xdg-open ssh://localhost
  6. Restart your web browser / application.
  7. Go to an ssh:// URI

    ssh://localhost
  8. Select "SSH Launcher" from the pop-up window. Optionally, check remember.
  9. Create links that use the ssh:// URI and Profit!!!

As a bonus, since the ssh:// protocol handler is simply calling the OpenSSH client, ssh, all of the tweaks to the ~/.ssh/config file apply. Inlcuding SSH Canonicalization.:-)

I have not tested this yet, but I believe I could make additional handlers for just about anything that I wanted to do.