Abu Sa'id Al-Khudri (May Allah be pleased with him) said:
The Prophet (ﷺ) said, "Avoid sitting on roadsides." His Companions said: "O Messenger of Allah (ﷺ), there is no other alternative but to sit there to talk." Thereupon the Messenger of Allah (ﷺ) said, "If you have to sit at all, then fulfill the rights of the road." They asked: "What are their rights?" Thereupon he said, "Lowering the gaze (so that you may not stare at unlawful things); refraining from doing some harm to others, responding to greeting (i.e., saying 'Wa'alaikumus- salam' to one another) and commanding the good and forbidding the evil."[Al-Bukhari and Muslim].
App reference: Book 18, Hadith 113
Arabic/English book reference: Book 18, Hadith 1623