Abdullah bin Abbas reported,

I heard the Prophet ﷺ delivering a sermon, saying, "No man should be alone with a woman unless she is accompanied by a Muharram, and no woman should travel except with a Muharram."A man stood up and said, "Messenger of Allah, my wife has set out for Hajj, and I have been enlisted for such-and-such a military expedition."He replied, "Go and perform Hajj with your wife."

Azami 4739

Sahih

عن ابن عباس، قال

سمعت النبي ﷺ يخطب يقول: لا يخلون رجل بامرأة إلا ومعها ذو محرم، ولا تسافر المرأة إلا مع ذي محرم. فقام رجل فقال: يا رسول الله، إن امرأتي خرجت حاجة وإني اكتتبت في غزوة كذا وكذا؟ قال: انطلق فحج مع أهلك.

الأعظمي 4739صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Obligation of Hajj, its virtue, and its conditions
Section
Presence of a husband or mahram with a woman when traveling for Hajj and Umrah
Numbering
Jami al-Kamil 4739 (2nd edition)
Azami 4739