Research and Takhrij: Muslim 342
وعن ابي هريرة ، ان رسول الله صلى الله عليه وسلم ، قال : اتقوا اللاعنين ، قالوا : وما اللاعنان يا رسول الله ؟ قال : الذى يتخلى فى طريق الناس او ظلهم
Abu Hurairah (may Allah be pleased with him) narrated that the Messenger of Allah ﷺ said: “Beware of the two things that bring about cursing.” The people said, “What are the two things that bring about cursing?” He said: “The one who relieves himself in the people’s path, or in their shade.”
Research and Takhrij: Muslim: 269
وروي ابو داود و النسائي حديثاً ، رواه حميد بن عبدالرحمن عن رجل صحب النبى صلى الله عليه وسلم كما صحبه ابو هريره وفيه : النهي عن البول فى المغتسل
Abu Dawud and al-Nasa’i narrated a hadith, which Humaid bin Abdul Rahman narrated from a man who had the honour of being a Companion of the Prophet ﷺ in the same way that Abu Hurairah (may Allah be pleased with him) had the honour of being his Companion. This hadith mentions the prohibition of urinating in the bathing place.
Research and Takhrij: This hadith is sahih (authentic). Musnad Imam Ahmad bin Hanbal: 4/ 110, 111, Abu Dawud 28, Nasa’i: 1/ 130, Mustadrak al-Hakim: 1/ 168, al-Bayhaqi: 1/ 98.
Benefits:
➊ One should go far away to relieve oneself.
➋ For relieving oneself, one should look for a place with dense trees or for mounds.
➌ Urinating and defecating under the trees planted along thoroughfares or paths is strictly forbidden; this act invites cursing.
➍ It is not right to sit down on the path or to make no attempt to conceal oneself. Likewise, many people sit down on paths and by streams and drains to wash their hands without looking out for anyone coming and going; this act is contrary to etiquette and modesty.
➎ One should not urinate in the bathing place.