Sahih Muslim 1341 a
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، كِلاَهُمَا عَنْ سُفْيَانَ، - قَالَ أَبُو بَكْرٍ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، - حَدَّثَنَا عَمْرُو بْنُ دِينَارٍ، عَنْ أَبِي مَعْبَدٍ، قَالَ سَمِعْتُ ابْنَ عَبَّاسٍ، يَقُولُ سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَخْطُبُ يَقُولُ لاَ يَخْلُوَنَّ رَجُلٌ بِامْرَأَةٍ إِلاَّ وَمَعَهَا ذُو مَحْرَمٍ وَلاَ تُسَافِرِ الْمَرْأَةُ إِلاَّ مَعَ ذِي مَحْرَمٍ " . فَقَامَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ إِنَّ امْرَأَتِي خَرَجَتْ حَاجَّةً وَإِنِّي اكْتُتِبْتُ فِي غَزْوَةِ كَذَا وَكَذَا . قَالَ " انْطَلِقْ فَحُجَّ مَعَ امْرَأَتِكَ " ."
Ibn 'Abbas (Allah be pleased with them) reported:
I heard Allah's Messenger (ﷺ) delivering a sermon and making this observation:" No person should be alone with a woman except when there is a Mahram with her, and the woman should not undertake journey except with a Mahram." A person stood up and said: Allah's Messenger, my wife has set out for pilgrimage, whereas I am enlisted to fight in such and such battle, whereupon he said:" You go and perform Hajj with your wife."
Full reference and source
Sahih Muslim 1341 a In-book : Book 15, Hadith 476 USC-MSA web (English) : Book 7, Hadith 3110 (deprecated)
View source on Sunnah.com (opens in a new tab)