Nomisoft
Menu

Ubuntu terminal shortcuts

10th May 2015
Terminal right click SSH menu
Terminal right click SSH menu

Here's how to get a nice little right click menu with shortcuts to ssh logins in the Unity sidebar. It avoids having to open a terminal and type 'ssh ...' every time you want to login to a paricular server via SSH

Copy the default terminal launcher to the specified folder in your home directory


cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications

Open the file in your chosen text editor and find the following line


OnlyShowIn=GNOME;

And change it to


OnlyShowIn=GNOME;Unity;

Copy and paste the below to the bottom of the file


X-Ayatana-Desktop-Shortcuts=Server1;Server2;Server3;

[Server1 Shortcut Group]
Name=Server 1
Exec=gnome-terminal --disable-factory --sm-client-disable  --class=remoteserver -x ssh -t server1.domain.com
TargetEnvironment=Unity

[Server2 Shortcut Group]
Name=Server 2
Exec=gnome-terminal --disable-factory --sm-client-disable  --class=remoteserver -x ssh -t server2.domain.com
TargetEnvironment=Unity

[Server3 Shortcut Group]
Name=Server 3
Exec=gnome-terminal --disable-factory --sm-client-disable  --class=remoteserver -x ssh -t server3.domain.com
TargetEnvironment=Unity

Replacing the names Server1, Server2, Server3 with your own server names. Also replace the servers urls at the end of each 'Exec' line.

Now drag and drop this .desktop file onto your Unity sidebar and when you right click the new terminal shortcut you should see the new custom menu. You might have to logout and back in if it doesn't show first time.