29

Is there an application (or GnomePanel plugin) that allows one to store SSH connection information and open a terminal on click?

I know that Nautilus does that using Ubuntu's "Password and Encryption keys", but is there such a thing for a terminal?

10 Answers 10

10

Much simplier method than installing an app.

Create a directory on your desktop (for example, call it ssh).

In your favourite editor, create a file called [servername i want to ssh to].desktop

In that file

[Desktop Entry]
Version=1.0
Type=Application
Name=SERVER NAME
Comment=ssh to SERVER NAME
Exec=ssh user@SERVER NAME
Icon=
Path=
Terminal=true
StartupNotify=false

Now mark the file as executable. Done.

Hope that helps.

3
  • 1
    +1 for the Desktop entry approach: simple, clear and manageable! Just keep in mind that when your username has a \ in it (as with likewise-open ids where the NT domain has to be prepended), the ssh command itself needs 2 backslashes, and the command in the .desktop entry thus needs 4, eg [domain]\\\\[username]@[server]
    – 4levels
    May 20, 2015 at 9:10
  • 3
    Hello , did you test it on an Ubuntu 20.04 ? Seems that's stop working Apr 28, 2020 at 10:37
  • Thanks, it's still useful today. Even simpler using a menu editor like menulibre. Jul 26, 2021 at 15:57
8

Gnome Connection Manager is definately worth a try. it offers some interesting features and is usable, though it's not quiet mature yet.

2
  • This is a next example. that simple applications are the good ones. GCM acts only as a SSH connection manager and nothing else - and that is its advantage. Nov 9, 2018 at 17:19
  • Tried that, installation works but does not launch. I have to create my script to run it, like python3 gnome-connection-manager.py in the desktop file. Otherwise is good. Still updating till today(2021), which is good.
    – WesternGun
    Jul 29, 2021 at 10:17
7

Are you just bothered about punching in your details each time you can use SSH key authentication so your user can log into other computers without a password. It's fairly powerful stuff and quite simple to get started.

First you need to generate a key for your user. This comprises of a public key and a private key. (Sidebar: Never ever, ever, ever give anybody your private key.) Just run:

ssh-keygen

It'll ask if you want a passphrase that has to be entered each time you use the key. That's up to you. Completely optional.

When you're done there you just upload your key to the server. Thankfully there's even a little application to handle that for you:

ssh-copy-id remote_user@remote_host

Then ssh remote_user@remote_host should just log in without prompt.

For your one-click launchers, you can just make a launcher with the following sort of command:

gnome-terminal -e "ssh remote_user@remote_host"

I also write little alias scripts in my ~/.bash_aliases file that fire off the connection (because I'm really lazy!).

1
  • Thanks for the comment! I am using publickey where available, unfortunately some sites I am working with (i'm a web-developer) only allow keyboard auth Jan 17, 2011 at 16:24
6

I've been using Remmina in Ubuntu for a while, I think it works very well and It's easy to use. It's very similar to Putty and it has support for different protocols like DP, VNC, SPICE, NX, XDMCP, SSH and EXEC.

Remmina main window

1
  • Thank you very much! Just what I was looking for.
    – Yehor
    Aug 16, 2022 at 8:48
5

Take a look at 'sshch'

enter image description here

This util store SSH connection information, but uses curses interface.

2
  • really nice app!
    – Vano
    Apr 30, 2018 at 8:45
  • I was hoping something like this existed, thanks!
    – jamzsabb
    Jun 3, 2018 at 17:00
4

Take a look at SSHMenu - it integrates into the Gnome panel, and allows opening a terminal per connection.

sshmenu-gnome

sudo apt-get install sshmenu-gnome
1
  • 2
    Tried that, great app. But it only works with publickey authentication. At least I didn't find a way to provide a password Jan 17, 2011 at 16:38
1

I have made for myself a simple ssh manager for ubuntu. If you want, you can also try it: https://github.com/Doka-NT/ssh-manager

All configs are in .json file. By default it use gnome-terminal, but you can change it to some other

1

You can try redial. It is a simple shell application that manages your SSH sessions on the Unix terminal.

pip3 install redial

Features:

  • add folder
  • copy ssh key
  • remove connection
  • edit connection
  • dynamic, local and remote port forwarding
  • midnight commander
0

The Desktop Application approach is good, but if you'd rather a custom action on the Terminal app menu, read this.

Edit the Terminal desktop launcher file to add your custom ssh-my-remote Action and define it further down.

// /usr/share/applications/org.gnome.Terminal.desktop
[Desktop Entry]
Name=Terminal
Comment=Use the command line
...
Actions=new-window;preferences;ssh-my-remote; // added the custom action name here
...
[Desktop Action preferences]
Name=Preferences
Exec=gnome-terminal --preferences

[Desktop Action ssh-my-remote]
Name=SSH My Remote
Exec=gnome-terminal -- ssh myuser@myremoteip

Run the desktop-file-install command to update the Terminal launcher.

desktop-file-install /usr/share/applications/org.gnome.Terminal.desktop

Right click the terminal app and click "SSH My Remote".

Custom Remote SSH Menu in Terminal

Turns out the Desktop launcher syntax is documented (https://specifications.freedesktop.org/desktop-entry-spec/latest/), but it isn't the clearest to follow.

Note: This probably won't work for Password auth SSH, but its best practice to use SSH keys anyway (See @Oli for a great explaination of setting those up)

Other Note: I have tested it and you CAN use Password Auth still with this method

My braindump


I got really curious as to what extra things can be added to the .desktop file format and looked at some bundled files for inspiration.

find / -type f -name "*.desktop"

This lead me to the bundled terminal file at /usr/share/applications/org.gnome.Terminal.desktop

I made a backup of that file and played around with it for a bit.

Turns out there is a Desktop Action section you can add which lets you do something by right clicking the icon in the dock.

Doing a little more research, I found that there is a desktop installer.

I had to run

desktop-file-install /usr/share/applications/org.gnome.Terminal.desktop

This lead to an error saying something about actions not being defined.

There is a semi-colon separated list of custom actions that are allowed under the [Desktop Entry] definition under the Actions key.

When you add your custom action to that list it should look something like this

[Desktop Entry]
Name=Terminal
Comment=Use the command line
...
Actions=new-window;preferences;ssh-my-remote; // added the custom action name here
...
[Desktop Action preferences]
Name=Preferences
Exec=gnome-terminal --preferences

[Desktop Action ssh-my-remote]
Name=SSH My Remote
Exec=gnome-terminal -- ssh myuser@myremoteip

So then to open your SSH connection you just right click the terminal and select "SSH My Remote"

1
  • You're right, this doesn't answer the question directly. It seems to be more of a blog post type discovery of how to add a custom action to a gnome desktop application in Ubuntu. Jan 25, 2022 at 0:20
0

You can check GoTo utility, which is a simple command line SSH manager. It's still in development state, but already usable. I wrote it for my own needs but will be happy if it can be useful for someone else.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .