Using SSH from the Gnome menus

Some time ago I wrote in a SSHMenu related blog posting's comment thread that I found the Gnome panel's menu combined with gnome-terminal's profiles feature sufficient for my SSH needs. As a followup, I got a email a couple of days ago by someone asking if I knew how to do the same thing except opening Nautilus windows for the remote hosts. I replied, but apparently the email could never be delivered, so here's a quick recap.

Below, I'll use foo as the remote host name. Replace it with the name of whatever host you want to use.

Steps:

  • Open the menu editor, either by right-clicking on the menu or from System > Preferences > Main Menu.
  • Click on New menu to create a new submenu, call it "Remote hosts" or something.
  • Select the new menu, click on New Item to create a new menu item.

For terminals:

  • In the Launcher Properties window that opened after clicking New Item, set the launcher type to Application, give it a descriptive name like "ssh foo" and the following command: gnome-terminal --window-with-profile="Remote foo". You can also give the launcher an icon. I usually like to give an icon that I use also for the gnome-terminal profile. See below.
  • The launcher won't do much useful yet, beyond opening up a new terminal, so now you have to create the gnome-terminal profile "Remote foo".
  • Open up a gnome-terminal window.
  • If you value your screen real estate, you probably have hidden the terminal menu bar. You have to make it visible to access the new profile creation functionality, so bring up the context menu with the right mouse button and select Show Menubar.
  • In the gnome-terminal menu, select Edit > Profiles. Click on New to create a new profile and give it the name "Remote foo". Click Create.
  • In the General tab, you can give the profile an icon. As I said, I like to use an icon here and in the menu, but that's up to you. You can also specify host specific colors in the Colors tab.
  • In the Title and Command tab, check "Run a custom command instead of my shell", and specify ssh foo as the custom command.

Now you are set, and selecting ssh foo in your new Remote hosts should open up a new terminal window that prompts you for authentication information for foo.

Turns out using this for Nautilus is even less work. Assuming things work out.

  • In the Launcher Properties window, instead of specifying gnome-terminal as the command, type in nautilus ssh://login@foo .

Replace login with your login on foo.

That's it. No extra steps needed.

Now, if gnome-vfs does its magic, you'll get a new Nautilus window when you select your new menu entry, showing the contents of your home folder on foo. The other option is that you get a Nautilus window showing nothing, which seems to happen to me for some hosts. No idea what that's all about.

© Juri Pakaste 2023