It is narrated from Yahya bin Ya'mur (may Allah have mercy on him): "The Messenger of Allah (peace and blessings be upon him) passed by a gathering held on a road, and he (peace and blessings be upon him) said: 'Avoid sitting on the roads, for it is the path to Hellfire, or (he said) it is one of the paths of Satan.' The narrator said: Then he (peace and blessings be upon him) went on, until the people thought it was a definitive prohibition. Then he (peace and blessings be upon him) came back and said: 'Unless you give the road its due?' The Companions asked: What is the due of the road? He (peace and blessings be upon him) said: 'Lowering your gazes, guiding the one who has lost his way, and returning the greeting of peace.'" I say: The origin of this hadith is in the two Sahihs and other books of hadith, from the narration of Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him).
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب الأدب وغيره / 5458