Abdullah bin Abbas reported,

The Prophet ﷺ said, "No man should be alone with a woman except in the presence of a male relative she cannot marry."A man stood up and said, "Messenger of Allah, my wife has set out for Hajj, and I have enrolled in such-and-such a military expedition."He replied, "Go back and perform Hajj with your wife."

Bukhari 5233

Sahih

حدثنا علي بن عبد الله حدثنا سفيان حدثنا عمرو عن أبي معبد

عن ابن عباس

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

البخاري 5233صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Marriage
Chapter
A man must not be alone with a woman unless there is a mahram present, and entering upon a woman whose husband is absent
Numbering
Darussalam 5233
Bukhari 5233