Imam al-Nawawi's introduction to this chapter
قَالَ الله تَعَالَى: ﴿يَا أَيُّهَا الَّذِينَ آمَنُوا لاَ تَدْخُلُوا بُيُوتًا غَيْرَ بُيُوتِكُمْ حَتَّى تَسْتَأنِسُوا وَتُسَلِّمُوا عَلَى أَهْلِهَا﴾ [النور: ٢٧]، وقال تَعَالَى: ﴿وَإِذَا بَلَغَ الأَطْفَالُ مِنْكُم الحُلُمَ فَلْيَسْتَأذِنُوا كَمَا اسْتَأْذَنَ الَّذِينَ مِنْ قَبْلِهِمْ﴾ [النور: ٥٩].
Allah Almighty said: "O you who believe, do not enter houses other than your own houses until you have sought permission and greeted their inhabitants." (Surah al-Nur: 27)
And Allah Almighty said: "And when your children reach puberty, let them seek permission just as those before them sought permission." (Surah al-Nur: 59)
عن أَبي موسى الأشعري - رضي الله عنه - قَالَ: قَالَ رسول الله - صلى الله عليه وسلم: «الاسْتِئْذَانُ ثَلاثٌ، فَإنْ أُذِنَ لَكَ وَإِلاَّ فَارْجِعْ». متفقٌ عَلَيْهِ.
It is narrated from Sayyiduna Abu Musa al-Ash'ari (may Allah be pleased with him) that he said: The Messenger of Allah (peace and blessings be upon him) said: "Seeking permission is three times; if you are given permission (then well and good), otherwise go back."
(Agreed upon)
وعن سهلِ بنِ سعدٍ - رضي الله عنه - قَالَ: قَالَ رسول الله - صلى الله عليه وسلم: «إنَّمَا جُعِلَ الاسْتِئذَانُ مِنْ أَجْلِ البَصَرِ». متفقٌ عَلَيْهِ.
It is narrated from Sayyiduna Sahl bin Sa'd (may Allah be pleased with him) that he said: The Messenger of Allah (peace and blessings be upon him) said: "Seeking permission has been prescribed only because of the sight."
(Agreed upon)
وعن رِبْعِيِّ بن حِرَاشٍ، قَالَ: حَدَّثَنَا رَجُلٌ مِنْ بَنِي عَامِرٍ أنَّهُ اسْتَأذَنَ عَلَى النَّبيِّ - صلى الله عليه وسلم - وَهُوَ في بيتٍ، فَقَالَ: أألِج؟ فَقَالَ رسول الله - صلى الله عليه وسلم - لِخَادِمِهِ: «أُخْرُجْ إِلَى هَذَا فَعَلِّمهُ الاسْتِئذَانَ، فَقُلْ لَهُ: قُلِ: السَّلاَمُ عَلَيْكُمْ، أأدْخُل؟» فَسَمِعَهُ الرَّجُلُ، فَقَالَ: السَّلامُ عَلَيْكُمْ، أَأَدْخُل؟ فَأذِنَ لَهُ النَّبيُّ - صلى الله عليه وسلم - فدخلَ. رواه أَبُو داود بإسناد صحيح.
It is narrated from Rib'i bin Hirash (may Allah have mercy on him) that he said: A man from Banu Amir told us that he sought permission (to enter) from the Prophet (peace and blessings be upon him) while he was in a house, and said: Shall I barge in? So the Messenger of Allah (peace and blessings be upon him) said to his servant: "Go out to this man and teach him how to seek permission. Tell him: Say, 'Peace be upon you; may I come in?'" The man heard this and said: "Peace be upon you; may I come in?" So the Prophet (peace and blessings be upon him) gave him permission and he came in.
(Narrated by Abu Dawud with a sahih chain)
عن كِلْدَةَ بن الحَنْبل - رضي الله عنه - قَالَ: أتَيْتُ النبيَّ - صلى الله عليه وسلم - فَدَخَلْتُ عَلَيْهِ وَلَمْ أُسَلِّمْ، فَقَالَ النَّبيُّ - صلى الله عليه وسلم: «ارْجِعْ فَقُلْ: السَّلاَمُ عَلَيْكُمْ، أَأَدْخُل؟». رواه أَبُو داود والترمذي، وقال: «حديث حسن».
It is narrated from Sayyiduna Kildah bin al-Hanbal (may Allah be pleased with him) that he said: I came to the Prophet (peace and blessings be upon him) and went in to him without giving the greeting of peace, so the Prophet (peace and blessings be upon him) said: "Go back and say: 'Peace be upon you; may I come in?'"
(Narrated by Abu Dawud and al-Tirmidhi, and (al-Tirmidhi) said: a hasan hadith)