The rider should first greet the pedestrian, and the pedestrian the one who is seated and…

Sahih Muslim Book 39 Hadith 1

Sahih Muslim #2160

The Book of Greetings 39:1

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

The rider should first greet the pedestrian, and the pedestrian the one who is seated and a small group should greet a larger group (with as-Salam-u-'Alaikum).

Chapter: The One Who Is Riding Should Greet The One Who Is Walking, And The Smaller Group Should Greet The Larger Group

Grade: Sahih