Sahih al-Bukhari 440
Sahih al-Bukhari · Book 8: Prayers (Salat) · Sleeping of a men in the mosque
Narrated Nafi`:
حَدَّثَنَا مُسَدَّدٌ ، قَالَ حَدَّثَنَا يَحْيَى ، عَنْ عُبَيْدِ اللَّهِ ، قَالَ حَدَّثَنِي نَافِعٌ ، قَالَ أَخْبَرَنِي عَبْدُ اللَّهِ ، أَنَّهُ كَانَ يَنَامُ وَهْوَ شَابٌّ أَعْزَبُ لاَ أَهْلَ لَهُ فِي مَسْجِدِ النَّبِيِّ صلى الله عليه وسلم.
`Abdullah bin `Umar said: I used to sleep in the mosque of the Prophet (ﷺ) while I was young and unmarried.