Al-Kāfi - Volume 6 > The Undesirable Case of One’s Sleeping Alone and the Characteristics Prohibited because of its Frightfulness
Hadith #4

عِدَّةٌ مِنْ أَصْحَابِنَا عَنْ أَحْمَدَ بْنِ مُحَمَّدِ بْنِ خَالِدٍ عَنْ عُثْمَانَ بْنِ عِيسَى عَنْ سَمَاعَةَ بْنِ مِهْرَانَ قَالَ سَأَلْتُ أَبَا عَبْدِ اللَّهِ ( عليه السلام ) عَنِ الرَّجُلِ يَبِيتُ فِي بَيْتٍ وَحْدَهُ فَقَالَ إِنِّي لَأَكْرَهُ ذَلِكَ وَ إِنِ اضْطُرَّ إِلَى ذَلِكَ فَلَا بَأْسَ وَ لَكِنْ يُكْثِرُ ذِكْرَ اللَّهِ فِي مَنَامِهِ مَا اسْتَطَاعَ .

4. A number of our people have narrated from Ahmad ibn Muhammad ibn Khalid from ‘Uthman ibn ‘Isa from Sama‘ah ibn Mehran who has said the following: “I once asked abu ‘Abd Allah, ‘Alayhi al-Salam, about the case of a man who sleeps in a house alone. He (the Imam) said, ‘I dislike it but if it is an emergency, then it is not harmful, however, he must speak of Allah a great deal and as much as he can, when he goes to sleep.’”