When we sat with the Messenger of Allah ﷺ during prayer, we used to say, "Peace be upon Allah before His servants, peace be upon so-and-so and so-and-so."The Messenger of Allah ﷺ said, "Do not say, 'Peace be upon Allah,' for Allah Himself is Peace. Rather, when one of you sits, let him 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.' For when you say this, it reaches every righteous servant in the heavens and the earth, or between 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 messenger.' Then let each of you choose whichever supplication he likes best and make that supplication."
حدثنا مسدد أخبرنا يحيى عن سليمان الأعمش حدثني شقيق بن سلمة
كنا إذا جلسنا مع رسول الله ﷺ في الصلاة قلنا السلام على الله قبل عباده السلام على فلان وفلان فقال رسول الله ﷺ لا تقولوا السلام على الله فإن الله هو السلام ولكن إذا جلس أحدكم فليقل التحيات لله والصلوات والطيبات السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين فإنكم إذا قلتم ذلك أصاب كل عبد صالح في السماء والأرض أو بين السماء والأرض أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله ثم ليتخير أحدكم من الدعاء أعجبه إليه فيدعو به
Bukhari, Adhan, Chapter on what one may choose to supplicate after the tashahhud, though it is not obligatory, no. 835, from Musaddad, and Muslim, Prayer, Chapter on the tashahhud in prayer, no. 58/402, from the hadith of Sulayman Amash, with this same wording.