Sunan Abi Dawud, Hadith 2620

‘Abd Allaah bin Masud reported the Apostle of Allaah as saying “Listening and Obedience are binding on a Muslim whether he likes or dislikes, so long as he is not commanded for disobedience (to Allaah). If he is commanded to disobedience (to Allaah), no listening and disobedience are binding (on him).

حَدَّثَنَا مُسَدَّدٌ، حَدَّثَنَا يَحْيَى، عَنْ عُبَيْدِ اللَّهِ، حَدَّثَنِي نَافِعٌ، عَنْ عَبْدِ اللَّهِ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ السَّمْعُ وَالطَّاعَةُ عَلَى الْمَرْءِ الْمُسْلِمِ فِيمَا أَحَبَّ وَكَرِهَ مَا لَمْ يُؤْمَرْ بِمَعْصِيَةٍ فَإِذَا أُمِرَ بِمَعْصِيَةٍ فَلاَ سَمْعَ وَلاَ طَاعَةَ ‏" ‏ ‏.‏

sunnah.com

also referenced under: Hadith 2626 (DarusSalam)