The Messenger of Allah said, “Hear and obey (the ruler), for they will bear responsibility for that entrusted to them, and you for that entrusted to you”. Recorded by Muslim
The Messenger of Allah said, “You must hear and obey (the ruler) both in your hardship and your ease and with regard to what pleases you and what you dislike and even if you do not get your due”. Recorded by Muslim
The Messenger of Allah said, “Hear and obey even if a, Abyssinian slave with a head like a raisin is appointed over you”. Recorded by Bukhari
==========================
The Prophet said, ‘‘The person must obey in whatever he loves, and in whatever he hates, in ease and in hardship, in willingness and un-willingness; except if he is commanded to disobey Allah. So if he is commanded to disobey Allah, then he should not listen, not should he obey.’’ Recorded by Bukhari
Shaykh As-San’aani said in his explanation of the hadeeth of Abu Hurairah, raised to the Prophet (who is reported to have said), “One who defected from obedience (to the Amir (ruler)) and separated from the main body of the Muslims, if he died in that state he would die the death of one belonging to the days of Jaahiliyyah (i.e. would not die as a Muslim). Saheeh Muslim, Book 20, # 4555, English Translation.