We did not know what to say when we sat with the Messenger of Allah ﷺ during the 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 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 you say that, 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 His Messenger.' Then let each of you choose whatever supplication he likes best and pray with it."Sharik said, Jami, meaning Ibn Abu Shaddad, narrated to us from Abu Waail, from Abdullah, something similar. He said that the Prophet used to teach us certain words, though he did not teach them to us the way he taught us the testimony of faith in prayer, "Allah, unite our hearts, set right our affairs among ourselves, guide us to the paths of peace, deliver us from darkness into light, and keep us away from indecencies, both open and hidden. Bless us in our hearing, our sight, our hearts, our spouses, and our offspring. Turn to us in mercy, for You are the Ever-Relenting, the Merciful. And make us grateful for Your favor, praising You for it and accepting it, and complete it for us."
حدثنا تميم بن المنتصر أخبرنا إسحق يعني ابن يوسف عن شريك عن أبي إسحق عن أبي الأحوص عن عبد الله قال كنا لا ندري ما نقول إذا جلسنا في الصلاة وكان رسول الله ﷺ قد علم فذكر نحوه قال شريك وحدثنا جامع يعني ابن أبي شداد عن أبي وائل عن عبد الله بمثله قال وكان يعلمنا كلمات ولم يكن يعلمناهن كما يعلمنا التشهد اللهم ألف بين قلوبنا وأصلح ذات بيننا واهدنا سبل السلام ونجنا من الظلمات إلى النور وجنبنا الفواحش ما ظهر منها وما بطن وبارك لنا في أسماعنا وأبصارنا وقلوبنا وأزواجنا وذرياتنا وتب علينا إنك أنت التواب الرحيم واجعلنا شاكرين لنعمتك مثنين بها قابليها وأتمها علينا
[Sahih] Bayhaqi narrated it in al-Qadaa wal-Qadar (p. 67b) from the hadith of Abu Dawud with this wording, and its basis is found in Tirmidhi, no. 1105, and Nasai, nos. 1163, 1164. Shubah and Thawri also narrated it from Abu Ishaq with this wording, differing from the hadith of Sharik. Ahmad narrated it, 1/394, and Hakim graded it sahih, 1/265, according to the standard of Muslim, and Dhahabi agreed with him. Ibn Jurayj also narrated it from Jami bin Shaddad with this wording.