Skip to main content

How to enable SSH Forwarding on Mac OS X Snow Leopard

·240 words·2 mins· ·
Apple Osx Mac Ssh Forwarding Rubber Ssh-Agent Ssh-Add Snowleopard
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

The other day I was toying with Rubber to deploy a Rails3 app to Amazon EC2. I host the project code in a private Github repository, accessible only with my own SSH key.

In order to checkout your code an any EC2 instance you can do one of two things:

  1. Copy your private SSH key to the instance - This sounds easy enough, but has serious security implications. You do not want to be sending out your private SSH key, do you? That leaves you with option 2.

  2. Let SSH forward the authentication request to your local machine. This is call Forwarding and requires ssh-agent to be running on your system. You’re in luck, ssh-agent is started automatically on your mac.

Now, the problem is that in Leopard (10.5) SSH Forwarding was enabled by default. You guessed it, in Snow Leopard it has been disabled by default. So, it’s up to you to enable SSH Forwarding manually. Here goes:

  1. Open Terminal.app.
  2. sudo vi /etc/ssh_config
    You will be asked for your password now. Feel free to use your preferred editor here.
  3. Add the following two lines to the top of the file:
    Host *
    ForwardAgent yes
  4. Save the file and exit your editor.

All right sparky, you now have enabled SSH Forwarding. Have fun!

PS. If you have enabled “Remote Login” under Sharing Preferences, make sure to stop and start that service to notify it of the changes you just made.

Related

Run Internet Explorer 5, 5.5, 6 and 7 natively on Mac OS X Leopard or Tiger
·238 words·2 mins
Blog Features Apple Mac OS X MacOSX Osx Leopard Tiger Mac Windows Internetexplorer Explorer IE IE7 IE6 Parallels
Available for iPhone Development
·42 words·1 min
General Apple IPod Development Mac Iphone Sdk Hire Available
MacBook Pro: Black Screen of Death (or is it just faking?)
·402 words·2 mins
General Apple Mac Mbp Macbook Pro Death Black