The Messenger of Allah ﷺ said, "Beware of sitting in the roadways."The Companions said, "Messenger of Allah, we have no alternative but to sit there to converse with one another."He replied, "If you must sit there, then give the road its due."They asked, "Messenger of Allah, what is the due of the road?"He said, "Lowering the gaze, refraining from harm, returning greetings of peace, enjoining what is right, and forbidding what is wrong."
حدثنا عبد الرحمن حدثنا زهير بن محمد عن زيد بن أسلم عن عطاء بن يسار
قال رسول الله ﷺ إياكم والجلوس في الطرقات قالوا يا رسول الله ما لنا من مجالسنا بد نتحدث فيها قال فأما إذا أبيتم إلا المجلس فأعطوا الطريق حقه قالوا يا رسول الله فما حق الطريق قال غض البصر وكف الأذى ورد السلام والأمر بالمعروف والنهي عن المنكر
Its isnad is sahih. Bukhari related the hadith 3/173 in "Wrongdoing," chapter on courtyards of houses, Muslim 4/1704 no. 2121 in "Greetings," chapter on the right of sitting on the road, and Abu Dawud 4/25 no. 4815 in "Manners," chapter on manners of sitting.