Enabling VNC login to an Apple by remote ssh

Tech Notes
  1. ssh into the destination mac
  2. Run this command with your new password $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -activate -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw [newpassword]
  3. Tunnel in from your source computer with this command (the command won't terminate - CTRL+C when you've finished with VNC) ssh -L 5999:[lan.ipaddress]:5900 -N  user@remote.computer.com
  4. VNC to localhost on 5999 (or 99 depending on your VNC client)