Like Bealzebub, I'm also a little unsure of what you are asking.
It's my understanding that after completion of the shut-down checklist, the captain remains responsible for the security of the aircraft until handed over to another crew or the ground engineers.
If the diversion has been carried out to a port where arrangements exist with another company, security and passenger handling arrangements then become the responsibility of the handling company.
If, on the other hand, no handling agent is available, security remains the captain's responsibility until he or she is relieved. Whilst, in the airline scenario, passenger accomodation needs etc. are not the Captain's responsibility, professionalism usually rules, and he or she does everything possible to facilitate their needs.
Regards,
Old Smokey