Ibn 'Umar reported Allah's Messenger (ﷺ) having said this
None (of you) should milk the animal of another, but with his permission. Does any one of you like that his chamber be raided, and his vaults be broken, and his foodstuff be removed? Verily the treasures for them (those who keep animals) are the udders of the animals which feed them. So none of you should milk the animal of another but with his permission.
This hadith has been narrated through another chain of transmitters with a slight variation of words.