Sayyiduna Jabir (may Allah be pleased with him) narrates: The Prophet (peace and blessings be upon him) said: "The rider should greet the one who is walking, and the one who is walking should greet the one who is sitting; and of two people walking, whichever of them is first to greet is the more virtuous."
Al-Bazzar recorded it, and its narrators are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأدب / 12761