Yet another method of creating SSH shortcuts

Nov 28, '06 07:30:04AM

Contributed by: glowworm

There are a a number of hints here providing ways to create *.inetloc-based shortcuts for remote connections via SSH (secure shell), but these don't really allow ssh://user@site.com addresses or alternate ports (a must if the SSH server is internet-facing). The following method enhances the previous suggestions, and in addition, allows quick start of a session or scp from Terminal itself. For instance, rather than typing ssh -p 222 fred@web.host.com, you'll be able to type ssh web, or use the ssh:// hint to create a quick access icon in the Finder.

To start, open Terminal and type the following:

$ cd ~/.ssh
$ nano -w config
You will have a blank file where you can create a three- or four-line shortcut entry for each host in the form of:
host web
user fred
HostName web.host.com
port 222

host mail
user root
HostName mail.host.com
port 2000
Press Control-X then Y to save. Obviously, replace the relevant bits above with the information specific to your SSH connections. The port line is optional, for those servers not on port 22.

Now to test. In Terminal, type ssh web (or whatever you named it), and ssh should start, switch you to the alternate user and port, and place you at the login. Now you can follow the other hints -- start Text Edit and write ssh://web. Highlight this and drag it to your Desktop or a folder. Now clicking this shortcut will start Terminal with an ssh session using your pre-configured host, login name, and port information.

[robg adds: This worked as described for me.]

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20061120191523862