كتاب السلام
39  
The Book of Greetings
(2)
Chapter: One Of The Duties Of Sitting In The Street Is To Return Salam
(2)
باب مِنْ حَقِّ الْجُلُوسِ عَلَى الطَّرِيقِ رَدُّ السَّلاَمِ ‏‏
Sahih Muslim 2121 c

Abu Sa'id Khudri reported Allah's Apostle (ﷺ) as saying:

Avoid sitting on the paths. They (the Companions) said: Allah's Messenger, we cannot help but holding our meetings (in these paths) and discuss matters (there). Thereupon Allah's Messenger (ﷺ) said: If you insist on holding meetings, then give the path its due right. They said: What are its due rights? Upon this he said: Lowering the gaze, refraining from doing harm, exchanging of greetings. commanding of good and forbidding from evil.
حَدَّثَنَا سُوَيْدُ بْنُ سَعِيدٍ، حَدَّثَنَا حَفْصُ بْنُ مَيْسَرَةَ، عَنْ زَيْدِ بْنِ أَسْلَمَ، عَنْ عَطَاءِ، بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ إِيَّاكُمْ وَالْجُلُوسَ بِالطُّرُقَاتِ ‏"‏ ‏.‏ قَالُوا يَا رَسُولَ اللَّهِ مَا لَنَا بُدٌّ مِنْ مَجَالِسِنَا نَتَحَدَّثُ فِيهَا ‏.‏ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ إِذَا أَبَيْتُمْ إِلاَّ الْمَجْلِسَ فَأَعْطُوا الطَّرِيقَ حَقَّهُ ‏"‏ ‏.‏ قَالُوا وَمَا حَقُّهُ قَالَ ‏"‏ غَضُّ الْبَصَرِ وَكَفُّ الأَذَى وَرَدُّ السَّلاَمِ وَالأَمْرُ بِالْمَعْرُوفِ وَالنَّهْىُ عَنِ الْمُنْكَرِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2121c
In-book reference : Book 39, Hadith 3
USC-MSA web (English) reference : Book 26, Hadith 5376
  (deprecated numbering scheme)