Abu Hurayra reported that the Messenger of Allah, may Allah bless
him and grant him peace, said, "The person riding greets the person walking.
The person walking greets the person sitting. The small group greets the
large group."
'Abdu'r-Rahman ibn Shibl said that he heard the Prophet, may Allah
bless him and grant him peace, said, "The person riding should greet the
person on foot. The person on foot should greet the person who is seated.
The smaller group should greet the large. Whoever answers the greeting,
that is for him. Whoever does not answer it, has nothing."