The Prophet ﷺ said, "Whenever two Muslims meet and one takes the other's hand, Allah is bound to answer their supplication and not turn their hands away until He has forgiven them both."
عن النبي ﷺ قال: ما من مسلمين التقيا، فأخذ أحدهما بيد صاحبه، إلا كان حقا على الله أن يجيب دعاءهما، ولا يرد أيديهما حتى يغفر لهما.
Bazzar (6463) and Abu Yaala (4139) both narrated it through the route of Yusuf bin Yaqub Dubai Sadusi, who said, Maymun bin Ajlan told us, from Maymun bin Siyah, from Anas bin Malik, and he related it. Its chain is hasan because of Maymun bin Siyah, for his hadith is hasan unless the contrary becomes clear, and likewise Maymun bin Ajlan, about whom Abu Hatim said, "A shaykh," and Ibn Hibban mentioned him among the trustworthy narrators. He is also corroborated.This is what Imam Ahmad (12451) narrated from Muhammad bin Bakr (that is, Barsani), who said, Maymun Mariyy told us, Maymun bin Siyah told us, from Anas bin Malik, and he related it. This Maymun Mariyy is either Abu Muhammad Tamimi, who is unknown as was mentioned earlier in the discussion of the prayer of istikhara, or he is Maymun bin Musa Mariyy, who is truthful and is among the men of Taqrib. Both belong to the same generation, and each of them narrates from Maymun bin Siyah, and Muhammad bin Bakr Barsani narrates from both of them. In any case, the two routes support one another.As for what was narrated from Ibn Masud, from the Prophet ﷺ, who said, "Part of completing the greeting is taking the hand," it is daif. Tirmidhi (2730) narrated it from Ahmad bin Abdah Dabbi, who said, Yahya bin Salim Taifi told us, from Sufyan, from Mansur, from Khaythama, from a man, from Ibn Masud, and he related it. Tirmidhi said, "This is a gharib hadith, and we do not know it except through the hadith of Yahya bin Salim, from Sufyan." He said, "I asked Muhammad bin Ismail about this hadith, and he did not consider it preserved."