Abu Huraira reported God's Messenger as saying, “He who obeys me has obeyed God and he who disobeys me has disobeyed God; he who obeys the commander has obeyed me and he who disobeys the commander has disobeyed me. The imam is only a shield behind whom fighting is engaged in and by whom protection is sought; so if he commands piety and acts justly he will have a reward for that, but if he holds another view he will on that account be held guilty.”
Umm al-Husain reported God’s Messenger as saying, “If a slave who has been mutilated is made your commander and leads you in accordance with God’s Book, listen to him and obey.”
Ibn ‘Umar reported God’s Messenger as saying, “Hearing and obeying are the duty of a Muslim man both regarding what he likes and what he dislikes, as long as he is not commanded to perform an act of disobedience to God, in which case he must neither hear nor obey.”