From his father, who was one of the three whose repentance was accepted.Kaab bin al-Ashraf used to compose poetry mocking the Prophet ﷺ and inciting the disbelievers of Quraysh against him. When the Prophet ﷺ arrived in Medina, its people were a mixture, among them Muslims, polytheists who worshipped idols, and Jews. They used to harm the Prophet ﷺ and his companions, so Allah, the Mighty and Majestic, commanded His Prophet to be patient and to forgive. Concerning them Allah revealed, "And you shall certainly hear much that will grieve you from those who received the Book before you" [Aal Imran 3:186].When Kaab bin al-Ashraf refused to stop harming the Prophet ﷺ, the Prophet ﷺ ordered Saad bin Muaz to send a small group to kill him. So he sent Muhammad bin Salama, and he mentioned the story of his killing.When they had killed him, the Jews and polytheists were alarmed and came to the Prophet ﷺ the next morning, saying, "Our companion was attacked at night and killed."The Prophet ﷺ reminded them of what Kaab had been saying, and he invited them to draw up a document between him and them that they would abide by. So the Prophet ﷺ wrote a general document between himself, them, and the Muslims as a whole.
عن أبيه، وكان أحد الثلاثة الذين تيب عليهم، وكان كعب بن الأشرف يهجو النبي ﷺ ويحرض عليه كفار قريش وكان النبي ﷺ حين قدم المدينة وأهلها أخلاط، منهم المسلمون والمشركون يعبدون الأوثان: واليهود، وكانوا يؤذون النبي ﷺ وأصحابه، فأمر الله عزوجل نبيه بالصبر والعفو ففيهم أنزل الله: {ولتسمعن من الذين أوتوا الكتب من قبلكم} [آل عمران: ١٨٦] فلما أبى كعب بن الأشرف أن ينزع عن أذى النبي ﷺ أمر النبي ﷺ سعد بن معاذ أن يبعث رهطا يقتلونه. فبعث محمد بن سلمة، وذكر قصة قتله، فلما قتلوه فزعت اليهود والمشركون، فغدوا على النبي ﷺ فقالوا: طرق صاحبنا فقتل، فذكر لهم النبي ﷺ الذي كان يقول، ودعاهم النبي ﷺ إلى أن يكتب بينه وبينهم كتابا ينتهون إلى ما فيه، فكتب النبي ﷺ بينه وبينهم وبين المسلمين عامة صحيفة.
Abu Dawud (3000) reported it from Muhammad bin Yahya bin Faris, that Hakam bin Nafi narrated to them, he said, Shuayb informed us, from Zuhri, from Abdul-Rahman bin Abdullah bin Kaab, and he mentioned it.His saying, "from his father," means his grandfather, because his grandfather, Kaab bin Malik, is the one who was among the three.