كتاب السلام
39  
The Book of Greetings
(8)
Chapter: The Prohibition Of Being Alone With A Non-Mahram Woman Or Entering Upon Her
(8)
باب تَحْرِيمِ الْخَلْوَةِ بِالأَجْنَبِيَّةِ وَالدُّخُولِ عَلَيْهَا ‏‏
Sahih Muslim 2173

'Abdullah b. 'Amr. b. al-'As reported that some persons from Banu Hisham entered the house of Asma' daughter of 'Umais when Abu Bakr also entered (and she was at that time his wife). He (Abu Bakr) saw it and disapproved of it and he made a mention of that to Allah's Messenger (ﷺ) and said:

I did not see but good only (in my wife). Thereupon Allah's Messenger (ﷺ) said: Verily Allah has made her immune from all this. Then Allah's Messenger (ﷺ) stood on the pulpit and said: After this day no man should enter the house of another person in his absence, but only when he is accompanied by one person or two persons.
حَدَّثَنَا هَارُونُ بْنُ مَعْرُوفٍ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنِي عَمْرٌو، ح وَحَدَّثَنِي أَبُو الطَّاهِرِ، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، عَنْ عَمْرِو بْنِ الْحَارِثِ، أَنَّ بَكْرَ بْنَ سَوَادَةَ، حَدَّثَهُ أَنَّ عَبْدَ الرَّحْمَنِ بْنَ جُبَيْرٍ حَدَّثَهُ أَنَّ عَبْدَ اللَّهِ بْنَ عَمْرِو بْنِ الْعَاصِ حَدَّثَهُ أَنَّ نَفَرًا مِنْ بَنِي هَاشِمٍ دَخَلُوا عَلَى أَسْمَاءَ بِنْتِ عُمَيْسٍ فَدَخَلَ أَبُو بَكْرٍ الصِّدِّيقُ وَهِيَ تَحْتَهُ يَوْمَئِذٍ فَرَآهُمْ فَكَرِهَ ذَلِكَ فَذَكَرَ ذَلِكَ لِرَسُولِ اللَّهِ صلى الله عليه وسلم وَقَالَ لَمْ أَرَ إِلاَّ خَيْرًا ‏.‏ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ إِنَّ اللَّهَ قَدْ بَرَّأَهَا مِنْ ذَلِكَ ‏"‏ ‏.‏ ثُمَّ قَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى الْمِنْبَرِ فَقَالَ ‏"‏ لاَ يَدْخُلَنَّ رَجُلٌ بَعْدَ يَوْمِي هَذَا عَلَى مُغِيبَةٍ إِلاَّ وَمَعَهُ رَجُلٌ أَوِ اثْنَانِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2173
In-book reference : Book 39, Hadith 31
USC-MSA web (English) reference : Book 26, Hadith 5403
  (deprecated numbering scheme)