THIS is how you create SSH shortcuts on a Mac

In: Uncategorized

2 Apr 2010

You want to setup ssh connections so you just search in spotlight for the name, hit enter and you’re logged in? Like the built-in terminal program that comes in OS X and don’t want to find/install some other ssh management tool? Well I did too and this this is how it’s done.

1) edit your ssh config file:

vi ~/.ssh/config

type this in:

Host myServ
HostName web.myserver.com
Host myServ2
HostName web.myserver2.com
IdentityFile ~/keys/myfile.key

Host is just a nickname or alias for the connection, HostName is the actual hostname. And below that you can put any ssh configuration in for that host that you want. I use it mainly to include an identity file which is normally the -i argument when you ssh on the command line. All the configurations are listed here.

Now that you’ve setup all the params required to make the connection you should be able to ssh on the command line using the alias:

ssh myServ

2) Make a file that spotlight can find.

Open your favorite text editor and type this in ssh://username@alias:
ssh://root@myServ

Of course change the username, or just remove it if you want to be prompted for the username.

Now highlight that entire line and drag/drop it into a folder. That will create an inetloc file. Rename that file whatever you want (or leave the filename alone) and it’s now findable in spotlight, you hit enter and you’ll be automatically ssh’ed into your server.

Comment Form

About this blog

Nothing that notable about this blog. It's just going to be a place where we post random stuff.

Photostream

  • Chand: Hi could any one suggest, if few childs should be CDATA and dynamic value... How to get this with X [...]
  • Andrew: This is definitely a great start to the solution I need, but I need CDATA tags to be added dynamical [...]
  • Ed Moore: "solving by explaining" in Greek: επίλυση εξηγώντας . https://translate.googl [...]
  • original lipodrene: Can I simply just say what a comfort to find someone who genuinely knows what they're talking abou [...]
  • Ian Postnikoff: When I follow the above, downloads opens in Terminal as a UNIX-like window called Bash. It does not [...]