(4) باب السَّمْعِ وَالطَّاعَةِ لِلإِمَامِ مَا لَمْ تَكُنْ مَعْصِيَةً
Narrated Anas bin Malik:
Allah's Messenger (ﷺ) said, "You should listen to and obey, your ruler even if he was an Ethiopian (black) slave whose head looks like a raisin."
Reference: Sahih al-Bukhari 7142
In-book reference: Book 93, Hadith 6
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 9, Book 89, Hadith 256