The Prophet ﷺ said, "The example of a righteous companion..." and he mentioned something similar.
حدثنا عبد الله بن الصباح العطار حدثنا سعيد بن عامر عن شبيل بن عزرة
عن النبي ﷺ قال مثل الجليس الصالح فذكر نحوه
No references are available.
Chain classification, its isnad is hasan.It was narrated by Hakim, 4/280, from the hadith of Saeed bin Amir with this same chain, and he graded it sahih, and Dhahabi agreed with him, and it was faulted with something that does not detract from it.