Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:6247ʿAlī b. al-Jaʿd > Shuʿbah > Sayyār > Thābit al-Bunānī > Anas b. Mālik > Mar > Ṣibyān Fasallam ʿAlayhim

that he passed by a group of boys and greeted them and said, "The Prophet ﷺ used to do so."  

البخاري:٦٢٤٧حَدَّثَنَا عَلِيُّ بْنُ الْجَعْدِ أَخْبَرَنَا شُعْبَةُ عَنْ سَيَّارٍ عَنْ ثَابِتٍ الْبُنَانِيِّ عَنْ أَنَسِ بْنِ مَالِكٍ ؓ

أَنَّهُ مَرَّ عَلَى صِبْيَانٍ فَسَلَّمَ عَلَيْهِمْ وَقَالَ كَانَ النَّبِيُّ ﷺ يَفْعَلُهُ