I heard Sufyan narrate from the Prophet ﷺ, "Whoever obeys my commander has obeyed me, and whoever obeys me has obeyed Allah ."
قال قرئ على سفيان سمعت أبا الزناد عن الأعرج
عن النبي ﷺ فسمعت سفيان يقول من أطاع أميري فقد أطاعني ومن أطاعني فقد أطاع الله عز وجل
Its isnad is sahih. Muslim related it in 2:85, from Zuhayr bin Harb, from Ibn Uyayna, with this same isnad, similarly, though he did not give its wording but instead referred to the narration before it as conveying the same meaning, via Mughira bin Abdul-Rahman Hizami, from Abu Zinad.Bukhari related it in 6:82, similarly, as part of a hadith transmitted via Shuayb, from Abu Zinad. He also related it, conveying the same meaning, in 13:99, through the narration of Abu Salama bin Abdul-Rahman, from Abu Hurairah.