Abu Hurairah traced this back to the Prophet ﷺ, who said, "If one of you asks his neighbor's permission to fix a wooden beam into his wall, he should not refuse him."When Abu Hurairah related this to them, they lowered their heads. Seeing this, he said, "Why do I see you turning away from it? By Allah, I will keep hurling it between your shoulders."
حدثنا هشام بن عمار ومحمد بن الصباح قالا حدثنا سفيان بن عيينة عن الزهري عن عبد الرحمن الأعرج قال
يبلغ به النبي ﷺ قال إذا استأذن أحدكم جاره أن يغرز خشبة في جداره فلا يمنعه فلما حدثهم أبو هريرة طأطئوا رءوسهم فلما رآهم قال ما لي أراكم عنها معرضين والله لأرمين بها بين أكتافكم
Bukhari narrated it in "Wrongs" (al-Mazalim), chapter "A neighbor should not prevent his neighbor from driving a peg into his wall," hadith 2463, from the hadith of Zuhri, through this same chain, and Muslim narrated it in "Sharecropping" (al-Musaqat), chapter "Driving a peg into a neighbor's wall," hadith 1609, from the hadith of Sufyan bin Uyayna, through this same chain.