We did not know what to say at the end of every two units of prayer, other than to glorify, magnify, and praise our Lord, until Muhammad ﷺ was taught the openings and closings of all goodness. He said, "When you sit at the end of every two units of prayer, say, 'All greetings belong to Allah, and all prayers and pure deeds. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. 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 whichever supplication he likes best and call upon Allah with it."
كنا لا ندري ما نقول في كل ركعتين، غير أن نسبح ونكبر ونحمد ربنا، وأن محمدا ﷺ علم فواتح الخير وخواتمه، فقال: إذا قعدتم في كل ركعتين فقولوا: التحيات الله، والصلوات، والطيبات السلام عليك أيها النبي ورحمة الله وبركاته، السلام علينا وعلى عباد الله الصالحين، أشهد أن لا إله إلا الله، وأشهد أن محمدا عبده ورسوله، وليتخير أحدكم من الدعاء أعجبه إليه، فليدع الله عز وجل.
Nasai (1163) reported it. He said, Muhammad bin Muthanna told us, he said, Muhammad told us, he said, Shuba told us, he said, I heard Abu Ishaq narrating from Abu Ahwas, from Abdullah, and he mentioned it. Its chain is sahih, and Muhammad here is Ibn Jafar. Ahmad also reported it from him in his Musnad (4160). Abu Ahwas is Awf bin Malik bin Nadla Jushami, one of the men of Muslim.Ibn Khuzayma also graded it sahih (720), reporting it through the route of Muhammad bin Jafar with the same wording. Ibn Hibban likewise graded it sahih (1951), reporting it through another route from Shuba with the same wording.Nasai also reported it (1162), as did Tirmidhi (289), both of them from Yaqub bin Ibrahim Dawraqi, who said, Ubaydullah Ashjai told us, from Sufyan Thawri, from Abu Ishaq, from Aswad bin Yazid, from Abdullah bin Masud, who said, "The Messenger of Allah ﷺ taught us that when we sit during the two prostrations, we should say," and he mentioned the tashahhud in the same way.I say, Abu Ishaq was a mudallis and he narrated using ambiguous transmission wording (an), and some scholars have affirmed that he did not actually hear this from Aswad bin Yazid.