Bulugh al-Maram, Book 16, Hadith 1444 (In-Book)

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.

وَعَنْ عَلِيٍّ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ يُجْزِئُ عَنْ اَلْجَمَاعَةِ إِذَا مَرُّوا أَنْ يُسَلِّمَ أَحَدُهُمْ, وَيُجْزِئُ عَنْ اَلْجَمَاعَةِ أَنْ يَرُدَّ أَحَدُهُمْ } رَوَاهُ أَحْمَدُ, وَالْبَيْهَقِيُّ (1904)‏.‏ ‏4 ‏- حسن بشواهده رواه أبو داود (5210)‏، والبيهقي (9 / 49)‏.‏

sunnah.com

also referenced under: Book 16, Hadith 1488 (English)