The Messenger of Allah ﷺ set out for Tabuk and appointed Ali as his deputy in Madinah.Ali said, "Are you leaving me behind with the children and the women?"The Prophet ﷺ replied, "Are you not content to be in relation to me as Harun was to Musa, except that there is no prophet after me?"
إن رسول الله ﷺ خرج إلى تبوك، واستخلف عليا فقال: أتخلفني في الصبيان والنساء؟ قال: ألا ترضى أن تكون مني بمنزلة هارون من موسى، إلا أنه ليس نبي بعدي.
Bukhari narrated it in al-Maghazi (4416) and Muslim in the Virtues of the Companions (31:2404), both through the route of Shubah, from Hakam (that is, Ibn Utayba), from Musab bin Saad bin Abu Waqqas, from his father Saad bin Abu Waqqas, who said, and then he related it.