I heard the Messenger of Allah ﷺ say, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah. Whoever obeys the commander has obeyed me. The commander is but a shield. If he prays sitting, then pray sitting. When he says, 'Allah hears the one who praises Him,' say, 'O Allah, our Lord, to You belongs all praise,' for if the words of the people of the earth coincide with the words of the people of heaven, his past sins will be forgiven."
حدثنا عفان وبهز قالا حدثنا أبو عوانة عن يعلى بن عطاء عن أبي علقمة الأنصاري قال
سمعت رسول الله ﷺ يقول من أطاعني فقد أطاع الله ومن عصاني فقد عصى الله ومن أطاع الأمير فقد أطاعني إنما الأمير مجن فإن صلى جالسا فصلوا جلوسا أو قعودا فإذا قال سمع الله لمن حمده فقولوا اللهم ربنا لك الحمد فإنه إذا وافق قول أهل الأرض قول أهل السماء غفر له ما مضى من ذنبه
Its chain of transmission is sahih. Abu Alqama al-Ansari was their ally, of Persian origin, and he is trustworthy. Bukhari narrated the hadith in 4/77 in the book of Jihad, chapter "War is deception," Muslim in 3/1466 no. 1835 in the book of Leadership, chapter "The obligation of obeying rulers," Nasai in 7/154 no. 4193, and Ibn Majah in 2/954 no. 2859.9355/m1. "The leader is only a shield. If he prays sitting, then pray sitting, or seated. When he says, 'Allah has heard whoever praises Him,' say, 'Our Lord, to You belongs all praise,' for when this matches what the people of the earth say with what the people of heaven say, his past sins are forgiven."Sahih (9355/m1). Its chain of transmission is sahih. Bukhari narrated it in 1/187 in the book of the Times of Prayer, chapter "The obligation of the takbir and opening the prayer," Muslim in 1/309 no. 414 in the book of Prayer, chapter "The follower's following the imam," and Abu Dawud in 1/164 no. 603.9355/m2. He said, "Caesar will perish and there will be no Caesar after him, and Khosrow will perish and there will be no Khosrow after him."Sahih (9355/m2). Its chain of transmission is sahih. Bukhari narrated it in 4/104 in the book of Jihad, chapter "The saying of the Prophet ﷺ, 'Spoils of war have been made lawful for you,'" Muslim in 4/2236 no. 2918 in the book of Tribulations, chapter "The Hour will not come until a man passes...," and Tirmidhi in 4/497 no. 2216 in the book of Tribulations, chapter "What has been said about, when Khosrow is gone there will be no Khosrow," and he said, hasan sahih.9355/m3. He said, "Seek refuge in Allah from five things, from the punishment of Hell, the punishment of the grave, the trial of life and death, and the trial of the Messiah Dajjal."Sahih (9355/m3). Its chain of transmission is sahih. It is found in Nasai 8/276. Kaab's statement does not contradict the hadith, rather all of it is approximate.