Al-Ilmam bi-Ahadith al-Ahkam 230
وَعَن عبد الله هُوَ ابْن مَسْعُود رَضِيَ اللَّهُ عَنْه، قَالَ: كُنَّا (إِذا كُنَّا) مَعَ النَّبِي ﷺ فِي الصَّلَاة قُلْنَا: السَّلَام عَلَى الله من عباده، السَّلَام عَلَى فلَان وَفُلَان ﷺ، فَقَالَ النَّبِي ﷺ : " لَا تَقولُوا: السَّلَام عَلَى الله فَإِن الله هُوَ السَّلَام، وَلَكِن قُولُوا: التَّحِيَّات لله والصلوات والطيبات، السَّلَام عَلَيْك أَيهَا النَّبِي وَرَحْمَة الله وَبَرَكَاته، السَّلَام علينا وَعَلَى عباد الله الصَّالِحين، فَإِنَّكُم إِذا قُلْتُمْ ذَلِك أصَاب كُلَّ عبدٍ صالحٍ فِي السَّمَاء، أَو بَين السَّمَاء وَالْأَرْض، أشهد أَن لَا إِلَه إِلَّا الله وَأشْهد أَن مُحَمَّدًا عَبده وَرَسُوله، ثمَّ يتخيَّر من الدُّعَاء أعجبه إِلَيْهِ؛ فيدعو ". لفظ البُخَارِيّ وَهُوَ مُتَّفق عَلَيْهِ.
From ʿAbdullah, who is Ibn Masʿud, may Allah be pleased with him, who said: (When we were) with the Prophet ﷺ in the prayer, we would say: "Peace be upon Allah from His servants; peace be upon so-and-so and so-and-so." The Prophet ﷺ said: "Do not say: 'Peace be upon Allah,' for Allah is as-Salam [Peace]. Rather say: All greetings, prayers and good things are for Allah. Peace be upon you, O 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 heaven, or between the heaven 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 him choose of supplications whichever he likes best and supplicate." Al-Bukhari's wording, and it is agreed upon.