Avoid sitting on the paths. They (his Companions) said: Messenger of Allah, there is no other help to it (but to sit there as we) hold our meetings and discuss matters there. Thereupon Messenger of Allah ﷺ said: If you have to sit at all, then fulfil the rights, of the path. They said: What are their rights? Thereupon he said: Keeping the eye downward (so that you may not stare at the women), refraining from doing some harm to the other and exchanging mutual greetings (saying as-Salamu 'Alaikum to one another) and commanding the good and forbidding the evil. (Using translation from Muslim 2121a)
أَنَّ النَّبِيَّ ﷺ قَالَ «إِيَّاكُمْ وَالْجُلُوسَ فِي الطُّرُقَاتِ» قَالُوا يَا رَسُولَ اللَّهِ مَا لَنَا مِنْ مَجْلِسِنَا بُدٌّ نَتَحَدَّثُ فِيهَا قَالَ «فَإِذَا أَبَيْتُمْ إِلَّا الْمَجْلِسَ فَأَعْطُوا الطَّرِيقَ حَقَّهُ» قَالُوا مَا حَقُّ الطَّرِيقِ؟ قَالَ «غَضُّ الْبَصَرِ وَكُفُّ الْأَذَى وَرَدُّ السَّلَامِ وَالْأَمْرُ بِالْمَعْرُوفِ وَالنَّهْيُ عَنِ الْمُنْكَرِ»