The Book of Greetings
حَدَّثَنِي عُقْبَةُ بْنُ مُكْرَمٍ، حَدَّثَنَا أَبُو عَاصِمٍ، عَنِ ابْنِ جُرَيْجٍ، ح وَحَدَّثَنِي مُحَمَّدُ بْنُ، مَرْزُوقٍ حَدَّثَنَا رَوْحٌ، حَدَّثَنَا ابْنُ جُرَيْجٍ، أَخْبَرَنِي زِيَادٌ، أَنَّ ثَابِتًا، مَوْلَى عَبْدِ الرَّحْمَنِ بْنِ زَيْدٍ أَخْبَرَهُ أَنَّهُ، سَمِعَ أَبَا هُرَيْرَةَ، يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " يُسَلِّمُ الرَّاكِبُ عَلَى الْمَاشِي وَالْمَاشِي عَلَى الْقَاعِدِ وَالْقَلِيلُ عَلَى الْكَثِيرِ " .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)
From Sahih Muslim, whose reports the scholars accept as authentic.