"Messenger of Allah, are people really tormented in their graves?"The Messenger of Allah ﷺ said, "I seek refuge in Allah from that."Ayesha said that the Prophet ﷺ once went out, and the sun became eclipsed. We went out to the chamber, and women gathered around us. The Messenger of Allah ﷺ came toward us, and this was in the forenoon. He stood for a long time, then bowed for a long time, then raised his head and stood for less time than the first standing, then bowed for less time than his first bowing, then prostrated. He then stood for the second cycle and did the same, except that his bowing and standing were shorter than in the first cycle. Then he prostrated, and the sun cleared.When he finished, he sat on the pulpit and among what he said was, "People are tested in their graves like the trial of the Dajjal."Ayesha said, "After that, we used to hear him seeking refuge from the punishment of the grave."
أخبرنا محمد بن سلمة عن ابن وهب عن عمرو بن الحارث عن يحيى بن سعيد أن عمرة حدثته أن عائشة حدثتها أن يهودية أتتها فقالت أجارك الله من عذاب القبر
يا رسول الله إن الناس ليعذبون في القبور فقال رسول الله ﷺ عائذا بالله قالت عائشة إن النبي ﷺ خرج مخرجا فخسفت الشمس فخرجنا إلى الحجرة فاجتمع إلينا نساء وأقبل إلينا رسول الله ﷺ وذلك ضحوة فقام قياما طويلا ثم ركع ركوعا طويلا ثم رفع رأسه فقام دون القيام الأول ثم ركع دون ركوعه ثم سجد ثم قام الثانية فصنع مثل ذلك إلا أن ركوعه وقيامه دون الركعة الأولى ثم سجد وتجلت الشمس فلما انصرف قعد على المنبر فقال فيما يقول إن الناس يفتنون في قبورهم كفتنة الدجال قالت عائشة كنا نسمعه بعد ذلك يتعوذ من عذاب القبر
Bukhari transmitted it in the chapter on the eclipse, in the section on seeking refuge from the punishment of the grave during the eclipse, hadith 1049 and 1050, and Muslim transmitted it in the chapter on the eclipse, in the section on the mention of the punishment of the grave during the eclipse prayer, hadith 903, from the hadith of Yahya bin Saeed Ansari, with the same wording. It is also found in Kubra, hadith 1860.