It was narrated from Ibn 'Umar, that when he was young and single, with no family, at the time of the Messenger of Allah (ﷺ), he used to sleep in the Masjid of the Prophet (ﷺ).
Hadith ReferenceSunan an-Nasa'i / The Book of the Masjids / Hadith: 723
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:متفق عليه
Hadith Takhrij«صحیح البخاری/الصلاة 58 (440) ، وقد أخرجہ: (تحفة الأشراف: 8173) ، مسند احمد 2/120، سنن الدارمی/الصلاة 117 (1440) (صحیح)»