Abdullah bin Masud said, "When we prayed with the Prophet ﷺ, we used to say, 'Peace be upon Allah before His servants, peace be upon Jibrail and Mikail, and upon so-and-so and so-and-so,' meaning the angels. The Messenger of Allah ﷺ heard us and said, 'Do not say, "Peace be upon Allah," for Allah Himself is Peace. Rather, when you sit, say, "All greetings belong to Allah, and all prayers and all good things. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah." For when one says this, it reaches every righteous servant in the heavens and the earth. "I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and His Messenger."'"Muhammad bin Yahya reported to us that Abdul-Razzaq said that Thawri informed them, from Mansur, Amash, Husayn, Abu Hashim, and Hammad, from Abu Waail, and from Abu Ishaq, from Aswad and Abu Ahwas, from Abdullah bin Masud, from the Prophet ﷺ, a similar report.Muhammad bin Muamar reported to us that Qabisa said that Sufyan informed them, from Amash, Mansur, and Husayn, from Abu Waail, from Abdullah bin Masud. Qabisa also said, "And Sufyan narrated to us, from Abu Ishaq, from Abu Ubayda, Aswad, and Abu Ahwas, from Abdullah bin Masud, that the Prophet ﷺ used to teach them the tashahhud," and he mentioned a similar report.
حدثنا محمد بن عبد الله بن نمير حدثنا أبي حدثنا الأعمش عن شقيق بن سلمة عن عبد الله بن مسعود ح و حدثنا أبو بكر بن خلاد الباهلي حدثنا يحيى بن سعيد حدثنا الأعمش عن شقيق
كنا إذا صلينا مع النبي ﷺ قلنا السلام على الله قبل عباده السلام على جبرائيل وميكائيل وعلى فلان وفلان يعنون الملائكة فسمعنا رسول الله ﷺ فقال لا تقولوا السلام على الله فإن الله هو السلام فإذا جلستم فقولوا التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين فإنه إذا قال ذلك أصابت كل عبد صالح في السماء والأرض أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله حدثنا محمد بن يحيى حدثنا عبد الرزاق أنبأنا الثوري عن منصور والأعمش وحصين وأبي هاشم وحماد عن أبي وائل وعن أبي إسحق عن الأسود وأبي الأحوص عن عبد الله بن مسعود عن النبي ﷺ نحوه حدثنا محمد بن معمر حدثنا قبيصة أنبأنا سفيان عن الأعمش ومنصور وحصين عن أبي وائل عن عبد الله بن مسعود ح قال و حدثنا سفيان عن أبي إسحق عن أبي عبيدة والأسود وأبي الأحوص عن عبد الله بن مسعود أن النبي ﷺ كان يعلمهم التشهد فذكر نحوه
Bukhari narrated it in the Book of Adhan, chapter "The Testimony (Tashahhud) in the Final Sitting," hadith no. 831, 835, 6230, and Muslim in the Book of Prayer, chapter "The Testimony in Prayer," hadith no. 402, from the hadith of Amash through this chain, and it has multiple routes in both of their collections.