The Messenger of Allah ﷺ used to teach them this supplication just as he would teach them a surah of the Quran, "O Allah, I seek refuge in You from the punishment of Hell, and I seek refuge in You from the punishment of the grave, and I seek refuge in You from the evil of the Maseeh Dajjal, and I seek refuge in You from the trials of life and death."
حدثنا إسماعيل حدثنا مالك عن أبي الزبير عن طاوس عن ابن عباس مثله غير أنه قال من فتنة المسيح الدجال
Its isnad is sahih. It has already appeared through the route of Malik as well, no. 2168, and see the previous hadith.