Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to be able to click on SSH links that look like ssh://user@servername and have a gnome-terminal open that runs SSH inside of it.

After reading up on the XDG stuff I did the following:

I created a shell script in $HOME/bin/ssh-terminal with the following:

gnome-terminal -e "ssh $dest" &

This works from the command line.

I created $HOME/.local/share/applications/ssh-terminal.desktop with:

[Desktop Entry]
Name=SSH Terminal
Exec=ssh-terminal %u

I ran update-desktop-database ~/.local/share/applications/

Now when I try to run xdg-open ssh://user@hostname I get the following error:

$ xdg-open ssh://buildbot@
gvfs-open: sftp://buildbot@ error opening location: The specified location is not mounted

I don't want to open it as a sftp mount and I cannot seem to find where that is set!

Where do I go from here?

share|improve this question
up vote 5 down vote accepted

Writing a .desktop file is not enough. You also need to change the default setting for the mime type.

You can get the current default value with

 xdg-mime query default x-scheme-handler/ssh

and can change it with

 xdg-mime default ssh-terminal.desktop x-scheme-handler/ssh

The corresponding configuration file is $HOME/.local/share/applications/mimeapps.list.

share|improve this answer
Sorry about the late accept. This didn't work at the time I asked the question but I just tried it lately and it does now. Thanks. – Zan Lynx Oct 28 '14 at 21:54

None of this worked for me until I edited the following file and removed the SchemeAlias line:


[Mount] Type=sftp Exec=/usr/lib/gvfs/gvfsd-sftp AutoMount=false Scheme=sftp # SchemeAliases=ssh DefaultPort=22 HostnameIsInetAddress=true

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.