The Messenger of Allah ﷺ said, "Whoever among you is able to be like the man with the measure of rice, let him be like him."They asked, "Messenger of Allah, who is the man with the measure of rice?"He said, "Three men set out, and the sky clouded over them, so they entered a cave. Then a boulder came down from the top of the mountain and sealed the entrance upon them. They struggled with it but could not move it. So they said to one another, 'You have fallen into a terrible situation. Let each man pray by mentioning the best deed he has ever done. Perhaps Allah Most High will deliver us from this.'"One of them said, 'O Allah, You know that I had two elderly parents. I used to milk their milk for them and come to them, but they would already be asleep. So I would spend the night standing with their milk in my hands, unwilling to give it to anyone before them, and unwilling to wake them from their sleep, while my little children whimpered with hunger around me. If You know that I did this only out of fear of You, then relieve us.' The boulder shifted."The second said, 'O Allah, You know that I had a cousin, and nothing You created was dearer to me than she was. I asked her for herself, and she said, "No, by Allah, not for less than a hundred dinar." So I gathered the money and handed it to her. But when I sat with her as a man sits with his wife, she said, "Fear Allah, and do not break the seal except by its right." So I got up and left her. If You know that I did this only out of fear of You, then relieve us.' The boulder moved back until the sky became visible."The third said, 'O Allah, You know that I once hired a laborer for a measure of rice. When evening came I offered him his wage, but he refused to take it and went off, leaving it with me. I felt uneasy about keeping it, so I invested it for him and made it grow, until I bought cattle and a herdsman with it. After some time he met me and said, "Fear Allah, give me my wage, and do not wrong me." I said, "Go to those cattle and their herdsman and take them." He said, "Fear Allah, and do not mock me." I said, "I am not mocking you." So he went and drove them all away. If You know that I did this only seeking Your pleasure and out of fear of You, then relieve us.' Then the boulder rolled away, and they walked out."
حدثنا يعقوب حدثنا أبي عن صالح حدثنا نافع أن عبد الله بن عمر قال قال رسول الله ﷺ بينما ثلاثة رهط يتماشون أخذهم المطر فأووا إلى غار في جبل فبينما هم فيه حطت صخرة من الجبل فأطبقت عليهم فذكر الحديث مثل معناه
Its chain of transmission is sahih. Yaqub is Ibn Ibrahim bin Saad, whose reliability was already established at 1404, and we add here that he died in the year 208. Bukhari gave his biography in Al-Kabir 4/1/396 and in Al-Sagheer 229.Salih is Ibn Kaysan, whose reliability was already established at 1472, and we add here that he was a trustworthy Follower who narrated from Zuhri despite being older than him. Ibn Main said, "Salih was older than Zuhri, he heard from Ibn Umar and Ibn Zubayr." He also said, "Among the companions of Zuhri, none is more reliable than Malik, then Salih bin Kaysan." Musab Zubayri said, "He combined mastery of hadith, jurisprudence, and manly virtue." Bukhari gave his biography in Al-Kabir 2/2/289.This hadith repeats the one before it. Muslim also narrated it, 2:321, through the route of Yaqub bin Ibrahim bin Saad, with this same chain.Regarding his wording, "the rock settled" (hattat), one copy in the margin of manuscript K has "it settled down" (inhattat).A note. The narration of Bukhari, 4:340, which we referred to in the previous chain, was narrated by Bukhari from Yaqub, from Ibrahim, from Abu Asim, from Ibn Jurayj, from Musa bin Uqba. This Yaqub is Yaqub bin Ibrahim bin Kathir Dawraqi, the hadith master and teacher of the authors of the six books, who belongs to a later generation and died in the year 252.