AHMAD 4668: from Ibn ʿUmar —
“The Muslim is obliged to obey (the ruler) whether he likes it or not, unless he is commanded to commit an act of disobedience. If he is commanded to commit a sin then he should neither listen nor obey.” (Using translation from Ibn Mājah 2864)

أحمد ٤٦٦٨: عن ابن عمر —
عَنِ النَّبِيِّ ﷺ قَالَ السَّمْعُ وَالطَّاعَةُ عَلَى الْمَرْءِ فِيمَا أَحَبَّ أَوْ كَرِهَ إِلَّا أَنْ يُؤْمَرَ بِمَعْصِيَةٍ فَإِنْ أُمِرَ بِمَعْصِيَةٍ فَلَا سَمْعَ وَلَا طَاعَةَ


Sound Chain (Arnaʾūṭ)
Aḥmad > ʿAbdullāh b. ʿUmar ؓ
hadithunlocked.com