We used to say the greeting, name and greet each other in the prayer. Allah's Messenger (ﷺ) heard it and said:--"Say, 'at-tahiyyatu lil-lahi was-salawatu wat-taiyibatu . Assalamu 'Alaika aiyuha-n-Nabiyu warahmatu- l-lahi wa-barakatuhu. _ Assalamu alaina wa-'ala 'ibadi-l-lahi as-salihin.. Ashhadu an la ilaha illa-l-lah wa ashhadu anna Muhammadan `Abdu hu wa Rasuluh. (All the compliments are for Allah and all the prayers and all the good things (are for Allah). Peace be on you, O Prophet, and Allah's mercy and blessings (are on you). And peace be on us and on the good (pious) worshipers of Allah. I testify that none has the right to be worshipped but Allah and that Muhammad is His slave and Apostle.) So, when you have said this, then you have surely sent the greetings to every good (pious) worshipper of Allah, whether he be in the Heaven or on the Earth . "
Reported by Al-Bukhari (No. 1202, 831, 835, 6230, 6265, 7381), Muslim (No. 402a), Abu Dawud (No. 968), At-Tirmidhi (No. 289, 1105), An-Nasa’i (No. 1162, 1163, 1164, 1166, 1167, 1168, 1169, 1170), Ibn Majah (No. 899, 1892), Ahmad (No. 3381, 3439, 3683, 3724, 3725, 3726, 3739, 3804) and Ad-Darimi (No. 1306, 1307).
The Messenger of Allah (may Allah's peace and blessings be upon him) taught me the Tashahhud, with my hand between his two hands, as he would teach me a Surah from the Qur’an: "At-tahiyyātu lillāhi was-salawātu wat-tayyibātu as-Salāmu ‘alayka ayyuha an-nabiyyu wa rahmatullāhi wa barakātuh…
أُوتِيَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ جَوَامِعَ الْخَيْرِ وَخَوَاتِمَهُ - أَوْ قَالَ فَوَاتِحَ الْخَيْرِ - فَعَلَّمَنَا خُطْبَةَ الصَّلاَةِ وَخُطْبَةَ الْحَاجَةِ خُطْبَةُ الصَّلاَةِ التَّحِيَّاتُ لِلَّهِ…
Narrated by Abdullah ibn Mas‘ūd
Not gradedMuttafaq ‘alayh (Bukhari and Muslim)Musnad Ahmad 3381
Ibn ‘Abbās (may Allah be pleased with him) reported: The Messenger of Allah (may Allah’s peace and blessings be upon him) used to teach us the Tashahhud just as he used to teach us a Sūrah from the Qur’an. He used to say: "All blessed greetings and good prayers are due to Allah; peace be upon you…