Narrated Ali ibn Abu Talib: Abu Dawud said: Al-Hasan ibn Ali traced this tradition back to the Prophet ﷺ: When people are passing by, it is enough if one of them gives a salutation on their behalf, and that it is enough for those who are sitting if one of them replies.
Hadith Referenceسنن ابي داود / أبواب السلام / 5210
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:حسن, مشكوة المصابيح (4648), وللحديث شاھد عند الطبراني في الكبير (3/ 82، 83 ح 2730 وسنده حسن)
Ali (RAA) narrated that the Messenger of Allah (ﷺ) said: “When a group of people passes by, it is sufficient if one of them gives a salutation, and it is sufficient for those who are sitting that one of them replies.” Related by Ahmad and Al-Baihaqi.
Benefits: ➊ If one person from a group conveys the greeting of salam, then the obligation is fulfilled on behalf of all; otherwise, all will be sinful. The same ruling applies to responding to the greeting.
If one person conveys the salam, it is sufficient. From this, it is understood that if everyone gives the salam, it is better, and similarly, if all respond, that is superior.
Source: Sharh Bulugh al-Maram min Adillat al-Ahkam, Kitab al-Jami', Page: 42