Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah. Whoever obeys the leader has obeyed me, and whoever disobeys the leader has disobeyed me. The leader is a shield. When he says the takbir, say the takbir. When he bows, bow. When he says, 'Allah hears whoever praises Him,' say, 'O Allah, our Lord, to You belongs all praise,' for if your words coincide with the words of the angels, you will be forgiven. And if he prays sitting, then pray sitting."

Ahmad 9015

Sahih

حدثنا بهز حدثنا حماد بن سلمة قال أنبأنا يعلى بن عطاء عن أبي علقمة وقال أبو عوانة الأنصاري

عن أبي هريرة

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

أحمد 9015صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abu Hurairah
Numbering
Darussalam 9015
Ahmad 9015