The Prophet ﷺ said, "Beware of sitting in the roadways."The companions said, "Messenger of Allah, we have no choice but to hold our gatherings there to converse."The Messenger of Allah ﷺ replied, "If you must sit there, then give the road its due."They asked, "What is its due?"He said, "Lowering the gaze, refraining from causing harm, returning the greeting of peace, enjoining what is right, and forbidding what is wrong."
عن النبي ﷺ قال: إياكم والجلوس بالطرقات قالوا: يا رسول الله ما لنا بد من مجالسنا نتحدث فيها. قال رسول الله ﷺ: إذا أبيتم إلا المجلس، فأعطوا الطريق حقه قالوا: وما حقه؟ قال: غض البصر، وكف الأذى، ورد السلام، والأمر بالمعروف والنهي عن المنكر.
Bukhari related it in Book of Seeking Permission (6229), and Muslim in Book of Greetings (2121) following hadith (2161), both through chains from Zayd bin Aslam, from Ata bin Yasar, from Abu Saeed Khudri, who mentioned it.