This hadith has been transmitted on the authority of Ibn Umar with a slight variation of wording (and the wording) that Messenger of Allah ﷺ said this on the pulpit.
عَنِ النَّبِيِّ ﷺ بِمِثْلِهِ وَفِي حَدِيثِ صَالِحٍ وَأُسَامَةَ أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ ذَلِكَ عَلَى الْمِنْبَرِ