Connecting to hidden SSH servers through Tor is somewhat of a pain. The following snippet makes it a bit easier.

First, make sure you have "connect-proxy" installed on the machine.

$ apt-get install connect-proxy

Now add, the following to $HOME/.ssh/config to automatically connect to .onion hosts through your local Tor proxy (port 9050).

Host *.onion

CheckHostIP no

Protocol 2

Compression yes