[HOW TO] Power iCal sharing over SSH tunnels.

michaelsanford

Translator, Web Developer
I was getting pretty peeved that I had to purchase a .Mac account to keep my calendars on my iBook and iMac synchronized, so I devised this solution.

The only caveat is that accessing your calendars requires a real-time connection to the internet, which I always have when I need to consult my calendar, but not everyone will. Nothing's perfect ;)

Before-you-proceed Checklist:
• Ensure that Personal File Sharing is enabled (Sharing pane)
• Ensure that Remote Login is enabled (Sharing pane)
• Ensure that your firewall has ssh, port 22, open (it is not necessary to open AFP, port 548, since we will be using an SSH tunnel).
• Ensure that you have backed up, merged, and deleted the ~/Library/Calendars folder on your so-called iCal Client machne (the one you will use to connect to your host). You need to have NO local ~/Library/Calendars folder for this to work, because you will be replacing it with a symlink.

Procedure:
• Create a forward SSH tunnel from your current computer to your so-called iCal Host, by entering this in the Terminal:
ssh username@your.host.com -L 10548.127.0.0.1:548

Once you are connected and presented with your remote command line, you don't have to type anything else in, the tunnel has been created. Just minimize or hide the window to get it out of your way.

• Mount your remote home folder over AFP (CMD-K in the Finder) and enter 127.0.0.1:10548 as the host. This will use your newly created SSH tunnel so that your calendars are accessed securely.

• You only need to do this step one time, but your AFP volume must be mounted in order to do it. Open a second terminal window, and create a symbolic link to your iCal Host's ~/Library/Calendars folder like so:
cd ~/Library ; ln -s /Volumes/your_AFP_mounted_home_folder/Library/Calendars

• Log out of the second terminal window, but leave the first one open, minimize or hide it to get it out of your way.

• Run iCal, and watch the magic of the BSD subsystem, the internet, and SSH come together to present you with your calendar.

When you're done you can unmount your remote home folder and log out of the first terminal window, and quit Terminal.

One huge advantage this method has over iCal + iSync is that there are no changes to merge, because you are working directly on the original calendars.
 
Back
Top