Sunan Abi Dawud, Book 20, Hadith 6 (Abu Dawud 2934)
Narrated Al-Miqdam ibn Ma'dikarib:
The Messenger of Allah (ﷺ) struck him on his shoulders and then said: You will attain success, Qudaym, if you die without having been a ruler, a secretary, or a chief.