The Messenger of Allah ﷺ said, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah. Whoever obeys the ruler has obeyed me, and whoever disobeys the ruler has disobeyed me."
وقال رسول الله ﷺ من أطاعني فقد أطاع الله ومن يعصيني فقد عصى الله ومن يطع الأمير فقد أطاعني ومن يعص الأمير فقد عصاني
This is sahih like the ones before it, and it is in the individual manuscript at number 21. The two Shaykhs (Bukhari and Muslim) did not narrate it through this route. It has already passed at 7330, 7428, and 7643, from more than one route on the authority of Abu Hurairah, and we mentioned that the two Shaykhs narrated it through another route.As for his saying "and whoever disobeys me" (wa man yasini), this is what is established in [manuscript] M and in the individual manuscript, while in [manuscript] H it reads "and whoever disobeys" (wa man yasni), which is a variant reading noted in the margin of M.