Sahih Bukhari | Volume 8 | Hadith Number 252A

Narrated by Abu Huraira
Allah's Apostle said, "The riding person 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."