autossh for keeping ssh sessions alive, during sleep

I learned the following from

Today, I wondered if there was a way to keep my IM and ssh sessions alive when putting my mac to sleep.

Because my IM connects through an ssh proxy, when I put my laptop to sleep, my ssh session dies, and my IM goes with it. When I wake my mac, I have to proxy through with another ssh session. This gets old when I’m at my desk and need to go to a meeting, etc.

So I installed autossh with macports “sudo port install autossh” and then run this to create an autossh session:

“autossh -M 20000 -t -D 1080”. After I enter my password, I have a proxy session for my IM. I launch IM, then put my mac to sleep. When it awakes, everything is working like a charm.

This entry was posted in Geek and tagged . Bookmark the permalink.

Leave a Reply

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