Abdullah bin Masud reported,

We used to recite the tahiyyat during prayer, mentioning names and greeting one another. The Messenger of Allah ﷺ heard us and said, "Say, 'All greetings, prayers, and good things belong to Allah. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and messenger.' For when you say this, you have greeted every righteous servant of Allah in the heavens and the earth."

Bukhari 1202

Sahih

حدثنا عمرو بن عيسى حدثنا أبو عبد الصمد عبد العزيز بن عبد الصمد حدثنا حصين بن عبد الرحمن عن أبي وائل

عن عبد الله بن مسعود رضي الله عنه قال

كنا نقول التحية في الصلاة ونسمي ويسلم بعضنا على بعض فسمعه رسول الله ﷺ فقال قولوا التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله فإنكم إذا فعلتم ذلك فقد سلمتم على كل عبد لله صالح في السماء والأرض

البخاري 1202صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Work during prayer
Chapter
One who names people or greets someone during prayer while facing away from them without knowing
Numbering
Darussalam 1202
Bukhari 1202