The Prophet ﷺ, when he entered the mosque, would say, "I seek refuge in Allah the Magnificent, in His Noble Face, and in His Eternal Sovereignty, from the accursed Satan."He asked, "Is that all?"I said, "Yes."He said, "When he says that, Satan says, 'He is protected from me for the rest of the day.'"
عن النبي ﷺ أنه كان إذا دخل المسجد قال: أعوذ بالله العظيم، وبوجهه الكريم، وسلطانه القديم، من الشيطان الرجيم. قال: أقط. قلت: نعم. قال: فإذا قال ذلك قال الشيطان: حفظ منى سائر اليوم.
Abu Dawud (466) reported it from Ismail bin Bishr bin Mansur, who said, Abdul-Rahman bin Mahdi told us, from Abdullah bin Mubarak, from Haywa bin Shurayh, who said, I met Uqba bin Muslim and said to him, "It has reached me that you narrate from Abdullah bin Amr bin As, from the Prophet ﷺ, that when he entered the masjid he would say," and he mentioned it.Its chain is hasan because of Ismail bin Bishr, for his hadith is hasan. Nawawi said in Khulasa (916), "Its chain is good."