Easily access SSH connections on your Mac

After reading a tip (and the comments) at macosxhints.com about how to mount a server via the finders sidebar using automator I came up with a very easy way to access my server via SSH in the Terminal.

This method lets you open the Terminal, automatically ssh’ed into your server, via Spotlight, the Finders Sidebar, the Dock, your Desktop or anywhere else you can think of.
The following is a step by step tutorial on how to achieve this.

  1. First you make sure your server is accessible without a password (via ssh public key authentication) for your own convenience. This step can be left out as well but it is much better this way ;)
    Read about how to set this up here. The entry is in german but the steps you have to take are in english, so it should be easy to follow.
  2. Open up TextEdit with a new document and fill in the address to the server in the following form:
    ssh://user@yourserver.comDraganddrop
    Select the text, click and hold until the cursor turns into your normal mouse pointer. Now drag and drop the text to your desktop as shown in the picture to the right (click on it for a bigger view). This creates a shortcut file on your Desktop that you can rename to whatever you want. You can even change the icon on it!
    Now close TextEdit.
  3. Next choose a location for the file in your filesystem. I made a folder called “connections” in my home folder where I plan to keep all my server connection shortcuts. But we’re not stopping here. The shortcut is a normal file as any other in OS X, so you can drag it to your sidebar, keep it in your Dock, search for it with Spotlight or click on it in the Finder.

Findit-1

If you happen to use and love Launchbar like me, there is an even quicker way to open your server connection: Open the Launchbar Configuration ([CMD]+Y in Launchbar) and right click / [CRTL]+click in the left pane where all the different rules are listed. Click on New Rule -> Folder… and in the resulting dialog choose the folder where you keep your connection shortcuts.
Now you can open each of them by just typing the name of the shortcut in Launchbar and hitting enter.

digg story

, , , , , , ,

About Florian Beer

I am running my own company 42dev where I provide web application development & hosting services for my clients.

7 comments

  1. Is there a command like:

    ssh -D 3333 -f -C -q -N user@domain.com

    That uses all the above command-line parameters that can be clicked on and launches the Terminal or a edit to merge my command-line parameters into the SSH://user@domain.com?

    Thank You

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>