Sahih Muslim Book 26, Hadith Number 5376.

Chapter : The duty that one owes on the roadside is to respond the greeting of as-Salam-u-‘Alaikum.

Abu Sa’id Khudri reported Allah’s Apostle (may peace be upon him) as saying: Avoid sitting on the paths. They (the Companions) said: Allah’s Messenger, we cannot help but holding our meetings (in these paths) and discuss matters (there). Thereupon Allah’s Messenger (may peace be upon him) said: If you insist on holding meetings, then give the path its due right. They said: What are its due rights? Upon this he said: Lowering the gaze, refraining from doing harm, exchanging of greetings, commanding of good and forbidding from evil.