Abu Said Al-Khudri reported:
Allah's Apostle may Allah bless him and grant him peace said: Avoid sitting on the paths. They (his Companions) said: Allah's Messenger, there is no other help to it (but to sit there as we) hold our meetings and discuss matters there. Thereupon Allah's Messenger may Allah bless him and grant him peace 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.
It is not good to sit in vain on the roadside. If you are sitting on the roadside unwittingly, you should restrain eyes from evil and do not hurt anyone, but greet the greeting of the passersby, and when at times you should command the good and turn back from the bad.