Sahih Muslim 1835 a, b
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا الْمُغِيرَةُ بْنُ عَبْدِ الرَّحْمَنِ الْحِزَامِيُّ، عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ مَنْ أَطَاعَنِي فَقَدْ أَطَاعَ اللَّهَ وَمَنْ يَعْصِنِي فَقَدْ عَصَى اللَّهَ وَمَنْ يُطِعِ الأَمِيرَ فَقَدْ أَطَاعَنِي وَمَنْ يَعْصِ الأَمِيرَ فَقَدْ عَصَانِي " . وَحَدَّثَنِيهِ زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا ابْنُ عُيَيْنَةَ، عَنْ أَبِي الزِّنَادِ، بِهَذَا الإِسْنَادِ وَلَمْ يَذْكُر " وَمَنْ يَعْصِ الأَمِيرَ فَقَدْ عَصَانِي " ."
It has been narrated on the authority of Abu Huraira that the Holy prophet (ﷺ) said:
Whoso obeys me obeys God, and whoso disobeys me disobeys God. Whoso obeys the commander (appointed by me) obeys me, and whoso disobeys the commander disobeys me. The same tradition transmitted by different persons omits the portion: And whose disobeys the commander disobeys me.
Full reference and source
Sahih Muslim 1835 a, b In-book : Book 33, Hadith 46 USC-MSA web (English) : Book 20, Hadith 4518 (deprecated)
View source on Sunnah.com (opens in a new tab)