Abu Hurairah reported,

The Messenger of Allah ﷺ said to me, "What did your captive do last night?"I replied, "Messenger of Allah, he claimed he would teach me words by which Allah would benefit me, so I let him go."He asked, "What were they?"I said, "He told me, 'When you go to your bed, recite Ayat al-Kursi from its beginning to its end, "Allah, there is no deity except Him, the Ever-Living, the Sustainer of existence" [Baqarah 2:255].' And he said to me, 'A protector from Allah will remain with you, and no devil will come near you until morning.'" The companions were the most eager of people for goodness.The Prophet ﷺ said, "He told you the truth, though he is a great liar. Do you know whom you have been speaking with these past three nights, Abu Hurayrah?"He said, "No."He said, "That was a devil."

Azami 11255

Sahih

في قصة حفظ زكاة رمضان

عن أبي هريرة قال

قال لي رسول الله ﷺ: ما فعل أسيرك البارحة؟ قلت: يا رسول الله زعم أنه يعلمني كلمات ينفعني الله بها فخليت سبيله قال: ما هي؟ قلت: قال لي إذا أويت إلى فراشك، فاقرأ آية الكرسي من أولها حتى تختم الآية {الله لا إله إلا هو الحي القيوم} وقال لي: لن يزال عليك من الله حافظ، ولا يقربك شيطان حتى تصبح، وكانوا أحرص شيء على الخير، فقال النبي ﷺ: أما إنه قد صدقك وهو كذوب، تعلم من تخاطب منذ ثلاث ليال يا أبا هريرة؟ قال: لا، قال: ذاك شيطان.

الأعظمي 11255صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Morning and evening supplications
Section
Supplications and remembrances narrated when going to sleep and when waking up
Numbering
Jami al-Kamil 11255 (2nd edition)
Azami 11255