The Messenger of Allah ﷺ said, "No one should milk another person's livestock without his permission. Would any of you like someone to come to his storeroom, break open his pantry, and take away his food? The udders of their livestock store food for them just as pantries do. So let no one milk another person's livestock except with his permission."
حدثنا عبد الله بن مسلمة عن مالك عن نافع
أن رسول الله ﷺ قال لا يحلبن أحد ماشية أحد بغير إذنه أيحب أحدكم أن تؤتى مشربته فتكسر خزانته فينتثل طعامه فإنما تخزن لهم ضروع مواشيهم أطعمتهم فلا يحلبن أحد ماشية أحد إلا بإذنه
Sourced. Bukhari narrated it in the Book of Lost Property, Chapter: One should not milk anyone's livestock without their permission, no. 2435, and Muslim in the Book of Lost Property, Chapter: The prohibition of milking livestock without the owner's permission, no. 1726, from the hadith of Malik through this same chain. It is also found in Muwatta (Yahya's version), 2/971.