It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: "Beware of the two things that bring about curses," or he said: "Beware of the two things that cause people to curse." (That is, because of which people curse.) It was asked, "What are those two things?" The Prophet (peace and blessings of Allah be upon him) said: "The person who relieves himself in people's pathways or in places where they seek shade." Imam Abu Bakr (may Allah have mercy on him) says: « او ظلهم » "From among their shaded places," by this the Prophet (peace and blessings of Allah be upon him) meant those shaded places where people gather to benefit from the shade. I have deduced this from the hadith of Sayyiduna Abdullah bin Ja'far (may Allah be pleased with them both), that the Prophet (peace and blessings of Allah be upon him) liked to conceal himself for relieving himself behind an elevated place (such as a wall or a mound) or behind a cluster of date palms. Because by "hadaf" is meant a wall, and by "cluster of date palms" is meant a group of date trees. A garden is called a "cluster" (jhund) because of the abundance of trees. The shadow of a wall remains at all times except when the sun is at its zenith, while the shadow of a cluster of date palms remains all day (that is, even at the time of zenith its shadow remains). And the Prophet (peace and blessings of Allah be upon him) used to like that a person should conceal himself for relieving himself behind a wall or a cluster, even if both have shade.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الآداب المحتاج إليها في إتيان الغائط والبول إلى الفراغ منها / 67
Hadith Takhrij«صحيح مسلم: كتاب الطهارة ، باب النهي عن النخلى فى الطرق والظلال ، رقم: 269 ، سنن أبى داوٗد: 25 ، مسند احمد: 372/2 ، وابن حبان فى صحيحه: 1415 ، والحاكم: 296/1»
➊ This hadith is evidence that it is forbidden (haram) to relieve oneself in the pathways of people or under trees whose shade people use, because this causes harm to the Muslims. A passerby may become soiled with impurity and will be troubled by the foul smell.
[عون المعبود: 27/1]
➋ As for those paths which are not commonly used by people, and such shady trees under which it is not customary for people to seek shade, there is no prohibition against urinating or defecating there.
Source: Sahih Ibn Khuzaymah: Commentary by Muhammad Farooq Rafee, Page: 67
Abu Hurairah (RA) reported: The Messenger of Allah (ﷺ) said: Be on your guard against two things which provoke cursing. They (the companions present there) said: Messenger of Allah, what are those things which provoke cursing? He said: Easing on the thoroughfares or under the shades (where they take shelter and rest).
Shaykh Maulana Abdul Aziz Alvi
Hadith Commentary: Vocabulary of the Hadith:
(1) اتَّقُوااللَّعَّانَيْنِ: That is, those actions which become a cause of curse and reproach, which incite people to speak ill or invite them to do so, meaning, by habit, people send curses upon the one who does such an act.
(2) ألتَّخَلِّيْ: To relieve oneself (to answer the call of nature).
(3) طَرِيقالنَّاسِ: The pathway of people, the place where people come and go.
(3) فِيظِلِّهِمْ: Their shaded place, the place where people sit and rise, stay, camp, take a midday rest (not every shaded place is meant).
Benefits and Issues: If someone relieves himself on a path where people walk or in a shaded place where people sit to rest, then people will be harmed and troubled by this, as a result of which they will speak ill of him and curse him, therefore, one should avoid such an act. In some narrations, a third place is mentioned: watering places (the banks where people come and go for water). The purpose is that if a person has to relieve himself outside the home, he should sit in a place where people do not pass by and where it does not cause harm to others.
Source: Tuhfat al-Muslim: Commentary on Sahih Muslim, Page: 618