Create a handler for opening special URLs like 'ssh://'

Jan 11, 2024 by Thibault Debatty | 514 views

Linux Sysadmin

https://cylab.be/blog/318/create-a-handler-for-opening-special-urls-like-ssh

Sometimes when using a web application you may encounter a special URL that does not start with http or https, like ssh://192.168.0.123 for example. On a mobile device, your phone will usually open the appropriate application to handle this URL. Here is how to achieve the same on a Linux computer.

.desktop file

  1. Create a .desktop file in /usr/share/applications/, for example /usr/share/applications/ssh.desktop , with the following content:
[Desktop Entry]
Version=1.0
Type=Application
Name=Open SSH URL
Comment=Open ssh://... URL
Terminal=true
Exec=gnome-terminal -- ssh %u
Icon=utilities-terminal
MimeType=x-scheme-handler/ssh;

Most lines are self-explanatory. The two import lines are:

  • Exec=gnome-terminal -- ssh %u that shows the command to execute. In this example we open a terminal to execute ssh, and %u is the actual URL. Other parameters can be found on the desktop entry reference page
  • MimeType=x-scheme-handler/ssh; that states that this entry should be used (executed) to handle ssh:// URLs
  1. The .desktop file must executable:
sudo chmod +x /usr/share/applications/ssh.desktop
  1. Finally, you must update the desktop entries cache:
sudo update-desktop-database

Test

If you have an SSH server installed on your machine, you can now test your handler with a link like this one:

ssh://127.0.0.1

SSH-URL-opener.png

This blog post is licensed under CC BY-SA 4.0

A Practical Introduction to eBPF
Have you ever wanted to enhance your favorite distribution kernel with debugging, tracing, networking, security or plenty of other features without going through a long approval/testing/integration process managed by the Linux community? The extended Berkeley Package Filter (eBPF) is a Linux kernel feature that aims at running user-space code (eBPF programs) in the kernel, safely and efficiently, via the in-kernel eBPF machine. Let's discover how to build such programs.
Performance of virtual storage (part 2) : QEMU
In a previous blog post, I evaluated the performance penalty of virtual storage. I compared different host filesystems and different hypervisors (including QEMU). The conclusion was pretty harsh: in all tested configurations, virtual disks are almost 10 times slower than host drives. In this blog post, I will test additional QEMU configuration options, to see if I can get better results...
Performance penalty of storage virtualization
In a previous blog post, I showed how to use sysbench to benchmark a Linux system. I ran the tool on various systems I had access to, and I was staggered by the performance penalty of virtual storage: a virtual disk (vdi) is roughly 10 times slower than the actual disk it is reading from or writing to. In this blog post, I want to show the results of some additional tests that, sadly enough, will only confirm this observation...
This website uses cookies. More information about the use of cookies is available in the cookies policy.
Accept