There is no obedience through disobedience towards Allah Sunan Ibn Majah 2864

Arabic hadith text
حَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، أَنْبَأَنَا اللَّيْثُ بْنُ سَعْدٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عُمَرَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ الصَّبَّاحِ، وَسُوَيْدُ بْنُ سَعِيدٍ، قَالاَ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ رَجَاءٍ الْمَكِّيُّ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏ عَلَى الْمَرْءِ الْمُسْلِمِ الطَّاعَةُ فِيمَا أَحَبَّ أَوْ كَرِهَ إِلاَّ أَنْ يُؤْمَرَ بِمَعْصِيَةٍ فَمَنْ أُمِرَ بِمَعْصِيَةٍ فَلاَ سَمْعَ وَلاَ طَاعَةَ ‏"
Translation
It wasnarrated from Ibn ‘Umar that the Messenger of Allah (ﷺ)said

“The Muslim is obliged to obey (the ruler) whether he likes itornot, unless he is commanded to commit an act of disobedience. If heis commanded to commit a sin then he should neither listen nor obey.”