Sunan Abi Dawud, Hadith 5158

Narrated Rib'i: A man of Banu Amir told that he asked the Prophet for permission (to enter the house) when he was in the house, saying: May I enter ? The Prophet said to his servant: Go out to this (man) and teach him how to ask permission to enter the house, and say to him: "Say : Peace be upon you. May I enter?" The man heard it and said: Peace be upon you! May I enter ? The Prophet permitted him and he entered.

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو الأَحْوَصِ، عَنْ مَنْصُورٍ، عَنْ رِبْعِيٍّ، قَالَ حَدَّثَنَا رَجُلٌ، مِنْ بَنِي عَامِرٍ أَنَّهُ اسْتَأْذَنَ عَلَى النَّبِيِّ صلى الله عليه وسلم وَهُوَ فِي بَيْتٍ فَقَالَ أَلِجُ فَقَالَ النَّبِيُّ صلى الله عليه وسلم لِخَادِمِهِ ‏ "‏ اخْرُجْ إِلَى هَذَا فَعَلِّمْهُ الاِسْتِئْذَانَ فَقُلْ لَهُ قُلِ السَّلاَمُ عَلَيْكُمْ أَأَدْخُلُ ‏" ‏ ‏.‏ فَسَمِعَهُ الرَّجُلُ فَقَالَ السَّلاَمُ عَلَيْكُمْ أَأَدْخُلُ فَأَذِنَ لَهُ النَّبِيُّ صلى الله عليه وسلم فَدَخَلَ ‏.‏

sunnah.com

also referenced under: Hadith 5177 (DarusSalam)