Narrated Abu Huraira (RA): Allah’s Messenger (peace be upon him) said, “The riding one should greet the walking one, and the walking one should greet the sitting one, and the small number of persons should greet the large number of persons.”
Sahih al-Bukhari, Book 79, Hadith 6