Ali bin Abu Talib reported,

The Messenger of Allah ﷺ sent out an army and placed a man in command over them, instructing the soldiers to listen to him and obey. The commander kindled a fire and ordered them to plunge into it. Some of them refused to enter, saying, "We only fled from the Fire to follow the Prophet." Others were ready to enter it.When news of this reached the Prophet ﷺ, he said, "Had they entered it, they would have remained in it forever." Then he said, "There is no obedience in disobedience to Allah. Obedience is only in what is right."

Abu Dawud 2625

Sahih

حدثنا عمرو بن مرزوق أخبرنا شعبة عن زبيد عن سعد بن عبيدة عن أبي عبد الرحمن السلمي

عن علي رضي الله عنه

أن رسول الله ﷺ بعث جيشا وأمر عليهم رجلا وأمرهم أن يسمعوا له ويطيعوا فأجج نارا وأمرهم أن يقتحموا فيها فأبى قوم أن يدخلوها وقالوا إنما فررنا من النار وأراد قوم أن يدخلوها فبلغ ذلك النبي ﷺ فقال لو دخلوها أو دخلوا فيها لم يزالوا فيها وقال لا طاعة في معصية الله إنما الطاعة في المعروف

أبو داود 2625صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Jihad
Chapter
Obedience
Numbering
Darussalam 2625
Abu Dawud 2625