The Prophet ﷺ went out one day to one of the gardens of Madinah to relieve himself, and I followed behind him. When he entered the garden, I sat at its gate and said to myself, "Today I will be the doorkeeper of the Prophet ﷺ," though he had not instructed me to do so.The Prophet ﷺ went on, relieved himself, then sat on the edge of the well, uncovered his legs, and let them dangle into the well.Then Abu Bakr came, seeking permission to enter.I said, "Stay where you are until I seek permission for you."He stopped, and I went to the Prophet ﷺ and said, "Prophet of Allah, Abu Bakr is seeking permission to come in to you."He said, "Let him in, and give him the glad tidings of Paradise."So Abu Bakr entered and came to the right side of the Prophet ﷺ, uncovered his legs, and let them dangle into the well.Then Umar came, and I said, "Stay where you are until I seek permission for you."The Prophet ﷺ said, "Let him in, and give him the glad tidings of Paradise."So he came to the left side of the Prophet ﷺ, uncovered his legs, and let them dangle into the well. The edge of the well was now full, with no more room to sit.Then Uthman came, and I said, "Stay where you are until I seek permission for you."The Prophet ﷺ said, "Let him in, and give him the glad tidings of Paradise, along with a trial that will befall him." …the rest of the hadith.
خرج النبي ﷺ يوما إلى حائط من حوائط المدينة لحاجته، وخرجت في إثره، فلما دخل الحائط جلست على بابه، وقلت لأكونن اليوم بواب النبي ﷺ ولم يأمرني، فذهب النبي ﷺ، وقضى حاجته، وجلس على قف البئر، فكشف عن ساقيه، ودلاهما في البئر، فجاء أبو بكر، يستأذن عليه ليدخل، فقلت: كما أنت، حتى أستأذن لك، فوقف، فجئت إلى النبي ﷺ فقلت: يا نبي الله، أبو بكر يستأذن عليك، قال: ائذن له وبشره بالجنة. فدخل فجاء عن يمين النبي ﷺ، فكشف عن ساقيه ودلاهما في البئر، فجاء عمر فقلت: كما أنت حتى أستأذن لك، فقال النبي ﷺ: ائذن له وبشره بالجنة. فجاء عن يسار النبي ﷺ، فكشف عن ساقيه فدلاهما في البئر، فامتلأ القف فلم يكن فيه مجلس، ثم جاء عثمان فقلت: كما أنت حتى أستأذن لك، فقال النبي ﷺ: ائذن له وبشره بالجنة معها بلاء يصيبه… الحديث.
Bukhari narrated it in the Book of Tribulations (7097), and Muslim in the Book of the Virtues of the Companions (2403:29), both through Sharik bin Abdullah bin Abu Nimr, from Saeed bin Musayab, from Abu Musa Ashari, who said, and then he mentioned it. The wording given here is Bukhari's.