It is reported from a man of Banu Amir that he said: I sought permission from the Prophet (peace and blessings be upon him): "May I enter?" He (peace and blessings be upon him) said to his servant: "Go and teach him how to seek permission, and tell him to say: 'As-salamu alaykum' (Peace be upon you), may I enter?" The man heard it, so he sought permission in the same way, and he was given permission.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17667