Abu Hurairah reported,

The Messenger of Allah ﷺ was asked, "Who is the noblest of people?"He replied, "The most pious of them before Allah."They said, "This is not what we are asking you about."He said, "Then the noblest of people is Yusuf, the prophet of Allah, son of the prophet of Allah, son of the prophet of Allah, son of the friend of Allah."They said, "This is not what we are asking you about."He said, "Then you are asking me about the lineages of the Arabs. People are like ores. The best of them in the days of ignorance are the best of them in Islam, provided they gain understanding of religion."Muhammad bin Salam narrated to me, Abdah informed us, from Ubaydullah, from Saeed, from Abu Hurairah رضي الله عنه, from the Prophet ﷺ, with this same report.

Bukhari 3383

Sahih

حدثني عبيد بن إسماعيل عن أبي أسامة عن عبيد الله قال أخبرني سعيد بن أبي سعيد

عن أبي هريرة رضي الله عنه

سئل رسول الله ﷺ من أكرم الناس قال أتقاهم لله قالوا ليس عن هذا نسألك قال فأكرم الناس يوسف نبي الله ابن نبي الله ابن نبي الله ابن خليل الله قالوا ليس عن هذا نسألك قال فعن معادن العرب تسألوني الناس معادن خيارهم في الجاهلية خيارهم في الإسلام إذا فقهوا حدثني محمد بن سلام أخبرنا عبدة عن عبيد الله عن سعيد عن أبي هريرة رضي الله عنه عن النبي ﷺ بهذا

البخاري 3383صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Saying of Allah Most High, "Verily in Yusuf and his brothers were signs for those who ask"
Numbering
Darussalam 3383
Bukhari 3383