SSH works locally but not remotely
If all your machines are running Lion or Mountain Lion, and you're using the same iCloud account on them, then you can use iCloud to ssh as described in this blog post from One Thing Well

First, find your Back To My Mac account number by running.

dns-sd -E


Then SSH to another machine like so

ssh -2 -6 username@computer-name.[account number].members.btmm.icloud.com


You can also add this to your ~/.ssh/config to make it easier

Host mac-remote
User username
HostName computername.[account number].members.btmm.icloud.com
AddressFamily inet6
Protocol 2