This might tell you something. I just tested it.
Code:
# cat /var/log/messages | grep shutdown
Mar 29 21:01:17 tuna shutdown[14571]: shutting down for system halt
Edit: If you find a shutdown command, you can then search backwards for an ssh connection.