Sahih Muslim , Book 25, Hadith 5356 (USC-MSA) ⓘ
Abd Sa'id Khudri reported: We were in the company of Ubayy b. Ka'b that Abu Musa Ash'ari came there in a state of anger. He stood (before us) and said: I ask you to bear witness in the name of Allah whether anyone amongst you heard Allah's Messenger as saying: Permission (for entering the house) should be sought three times and if permission is granted to you (then get in). otherwise go back. Ubayy b. Ka'b said: What is the iiiatter? He said: I sought permission yesterday from 'Umar b. Khattab three times but he did not permit me, so I came back; then I went to him today and visited him and informed him that I had come to him yesterday and greeted him thrice, then came back, whereupon he said: Yes, we did hear you but be were at that time busy, but why did you not seek permission (further and you must have never gone back until you were permitted to do so). He said: I sought permission (in the manner) that I heard Allah's Messenger having said (in connection 'With the seeking of permission for entering the house of a stranger). Thereupon he (Hadrat Umar) said: By Allah, I shall torture your back and your stomach unless you bring one who may bear witness to what you state. 'Ubayy b. Ka'b said: By Allah, none should stand with you (to bear testimony) but the youngest amongst us. And he therefore, said to Abu Sa'id: Stand up. So I stood up until I came to Umar and said: I heard Allah's Messenger say this.
حَدَّثَنِي أَبُو الطَّاهِرِ، أَخْبَرَنِي عَبْدُ اللَّهِ بْنُ وَهْبٍ، حَدَّثَنِي عَمْرُو بْنُ الْحَارِثِ، عَنْ بُكَيْرِ بْنِ الأَشَجِّ، أَنَّ بُسْرَ بْنَ سَعِيدٍ، حَدَّثَهُ أَنَّهُ، سَمِعَ أَبَا سَعِيدٍ الْخُدْرِيَّ، يَقُولُ كُنَّا فِي مَجْلِسٍ عِنْدَ أُبَىِّ بْنِ كَعْبٍ فَأَتَى أَبُو مُوسَى الأَشْعَرِيُّ مُغْضَبًا حَتَّى وَقَفَ فَقَالَ أَنْشُدُكُمُ اللَّهَ هَلْ سَمِعَ أَحَدٌ مِنْكُمْ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " الاِسْتِئْذَانُ ثَلاَثٌ فَإِنْ أُذِنَ لَكَ وَإِلاَّ فَارْجِعْ " . قَالَ أُبَىٌّ وَمَا ذَاكَ قَالَ اسْتَأْذَنْتُ عَلَى عُمَرَ بْنِ الْخَطَّابِ أَمْسِ ثَلاَثَ مَرَّاتٍ فَلَمْ يُؤْذَنْ لِي فَرَجَعْتُ ثُمَّ جِئْتُهُ الْيَوْمَ فَدَخَلْتُ عَلَيْهِ فَأَخْبَرْتُهُ أَنِّي جِئْتُ أَمْسِ فَسَلَّمْتُ ثَلاَثًا ثُمَّ انْصَرَفْتُ قَالَ قَدْ سَمِعْنَاكَ وَنَحْنُ حِينَئِذٍ عَلَى شُغْلٍ فَلَوْ مَا اسْتَأْذَنْتَ حَتَّى يُؤْذَنَ لَكَ قَالَ اسْتَأْذَنْتُ كَمَا سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ فَوَاللَّهِ لأُوجِعَنَّ ظَهْرَكَ وَبَطْنَكَ . أَوْ لَتَأْتِيَنَّ بِمَنْ يَشْهَدُ لَكَ عَلَى هَذَا . فَقَالَ أُبَىُّ بْنُ كَعْبٍ فَوَاللَّهِ لاَ يَقُومُ مَعَكَ إِلاَّ أَحْدَثُنَا سِنًّا قُمْ يَا أَبَا سَعِيدٍ . فَقُمْتُ حَتَّى أَتَيْتُ عُمَرَ فَقُلْتُ قَدْ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ هَذَا .
also referenced under: Book 38, Hadith 43 (In-Book) & Hadith 2153 (Reference)