كتاب السلام
39  
The Book of Greetings
(9)
Chapter: It Is Recommended For The One Who Is Seen Alone With A Woman Who Is His Wife Or Mahram, To Say; "This Is So-And-So,' To Ward off Suspicion
(9)
باب بَيَانِ أَنَّهُ يُسْتَحَبُّ لِمَنْ رُئِيَ خَالِيًا بِامْرَأَةٍ وَكَانَتْ زَوْجَةً أَوْ مَحْرَمًا لَهُ
Sahih Muslim 2175 b

This hadith has been reported on the authority of Safiyya, the wife of Allah's Apostle (ﷺ), through another chain of transmitters (and the words) are:

" She went to Allah's Apostle (ﷺ) to visit him as he was observing I'tikaf in the mosque during Ramadan. She talked with him for some time and then stood up to go back and Allikh's Apostle (ﷺ) stood up in order to bid her good-bye." The rest of the hadith is the same except with the variation of the words that Allah's Apostle (ﷺ) said:" Satan penetrates in man like the penetration of blood (in every part of body)."
وَحَدَّثَنِيهِ عَبْدُ اللَّهِ بْنُ عَبْدِ الرَّحْمَنِ الدَّارِمِيُّ، أَخْبَرَنَا أَبُو الْيَمَانِ، أَخْبَرَنَا شُعَيْبٌ، عَنِ الزُّهْرِيِّ، أَخْبَرَنَا عَلِيُّ بْنُ حُسَيْنٍ، أَنَّ صَفِيَّةَ، زَوْجَ النَّبِيِّ صلى الله عليه وسلم أَخْبَرَتْهُ أَنَّهَا جَاءَتْ إِلَى النَّبِيِّ صلى الله عليه وسلم تَزُورُهُ فِي اعْتِكَافِهِ فِي الْمَسْجِدِ فِي الْعَشْرِ الأَوَاخِرِ مِنْ رَمَضَانَ فَتَحَدَّثَتْ عِنْدَهُ سَاعَةً ثُمَّ قَامَتْ تَنْقَلِبُ وَقَامَ النَّبِيُّ صلى الله عليه وسلم يَقْلِبُهَا ‏.‏ ثُمَّ ذَكَرَ بِمَعْنَى حَدِيثِ مَعْمَرٍ غَيْرَ أَنَّهُ قَالَ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ إِنَّ الشَّيْطَانَ يَبْلُغُ مِنَ الإِنْسَانِ مَبْلَغَ الدَّمِ ‏"‏ ‏.‏ وَلَمْ يَقُلْ ‏"‏ يَجْرِي ‏"‏ ‏.‏
Reference : Sahih Muslim 2175b
In-book reference : Book 39, Hadith 34
USC-MSA web (English) reference : Book 26, Hadith 5405
  (deprecated numbering scheme)