Not sure if you are saying you want a user's actions recorded once they ssh IN to your machane, or you want to record them when they ssh OUT. If it's the first, then couldn't you just run any commands/scripts from the /etc/profile file? It is read when a user's shell is started up I believe...