The Messenger of Allah ﷺ said, "The rider should greet the one walking, the one walking should greet the one sitting, and the smaller group should greet the larger group."
حدثنا روح حدثنا ابن جريج أخبرني زياد أن ثابتا مولى عبد الرحمن بن زيد أخبره أنه
قال رسول الله ﷺ ليسلم الراكب على الماشي والماشي على القاعد والقليل على الكثير
Bukhari narrated it in Adab from Abdul-Rahman bin Shibl, and Suyuti indicated in Jami Saghir that it is hasan. Darimi narrated it with this wording, "The rider greets the one walking, the standing greets the one sitting, and the few greet the many." Nasai and Tirmidhi also narrated it, and Tirmidhi graded it sahih, as did Ibn Hibban.