When a group of people pass by, it is sufficient if one of them extends the greetings on their behalf, and it is sufficient if one returns the greeting on behalf of a group
Good hadithعن علي بن أبي طالب رضي الله عنه مرفوعاً: «يُجْزِئُ عن الجماعة إذا مَرُّوا أن يُسَلِّم أحدهم، ويُجْزِئُ عن الجماعة أن يَرُدَّ أحدهم».
‘Ali ibn Abi Tālib (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "When a group of people pass by, it is sufficient if one of them extends the greetings on their behalf, and it is sufficient if one returns the greeting on behalf of a group."
Explanation
One person is sufficient to extend the greetings on behalf of a group, just as it is sufficient that one person returns the greetings on behalf of a group.
Source · Narrated by Abu Daoud
From the Hadith Encyclopedia (hadeethenc.com).