It is a duty for one Muslim to greet another Muslim
بَابُ حَقُّ الْمُسْلِمِ عَلَى الْمُسْلِمِ أَنْ يُسَلِّمَ عَلَيْهِ إِذَا لَقِيَهُ
Al-Adab Al-Mufrad, Book of Greetings(view book)
Al-Adab Al-Mufrad 991
Abu Hurayra said, "I heard the Messenger of Allah ﷺ say, 'The rights a Muslim has over another Muslim are six." He was asked, "What are they?" He replied, "When he meets him, he should greet him, When he gives him an invitation, he should accept. When he asks him for advice, he should give him good counsel. When he sneezes and praises Allah, he should wish him mercy. when he is ill, he should visit him. When he dies, he should accompany him."
حَدَّثَنَا إِسْمَاعِيلُ، قَالَ: حَدَّثَنَا مَالِكٌ، عَنِ الْعَلاَءِ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ ﷺ قَالَ: حَقُّ الْمُسْلِمِ عَلَى الْمُسْلِمِ سِتٌّ، قِيلَ: وَمَا هِيَ؟ قَالَ: إِذَا لَقِيتُهُ فَسَلِّمْ عَلَيْهِ، وَإِذَا دَعَاكَ فَأَجِبْهُ، وَإِذَا اسْتَنْصَحَكَ فَانْصَحْ لَهُ، وَإِذَا عَطَسَ فَحَمِدَ اللَّهَ فَشَمِّتْهُ، وَإِذَا مَرِضَ فَعُدْهُ، وَإِذَا مَاتَ فَاصْحَبْهُ.