My two ears heard the Messenger of Allah ﷺ say, "Whoever claims a father in Islam other than his real father, knowing that he is not his father, paradise is forbidden to him."
سمع أذناي من رسول الله ﷺ وهو يقول: من ادعى أبا في الإسلام غير أبيه، يعلم أنه غير أبيه، فالجنة عليه حرام.
Muslim narrated it in the Book of Faith (63) from Amr Naqid, who said, Hushaym bin Bashir told us, Khalid Haddan informed us, from Abu Uthman, who said, When Ziyad was claimed, I met Abu Bakra and said to him, "What is this thing you have done?" I had heard Saad bin Abu Waqqas say (and he mentioned it). Abu Bakra said, "I too heard it from the Messenger of Allah ﷺ."Bukhari narrated it in the Book of Inheritance (6766) through another route from Khalid, with his chain, in abbreviated form.As for Abu Uthman's statement, "When Ziyad was claimed, I met Abu Bakra and said to him, 'What is this thing you have done? I heard Saad bin Abu Waqqas say, my ears heard from the Messenger of Allah ﷺ as he said, "Whoever claims a father in Islam other than his real father, paradise is forbidden to him."' Abu Bakra said, 'I heard it from the Messenger of Allah ﷺ.'"The meaning of this statement is a rebuke directed at Abu Bakra, because the Ziyad mentioned is the one known as Ziyad bin Abu Sufyan, also called Ziyad bin Abih (son of his father, unnamed) and Ziyad bin Ummih (son of his mother). He was Abu Bakra's brother through their mother, and was known as Ziyad bin Ubayd Thaqafi. Then Muawiya bin Abu Sufyan claimed him, attaching him to his father Abu Sufyan, and he became one of Muawiya's companions after having previously been one of the companions of Ali bin Abu Talib . This is why Abu Uthman said to Abu Bakra, "What is this thing you have done?" meaning, what is this thing that has happened through your brother, how ugly it is, and how severe its punishment, for the Prophet ﷺ declared paradise forbidden to whoever does it.As for the word "udiya" (claimed), we have recorded it with damma on the dal and kasra on the ayn, in the passive form, meaning that Muawiya claimed him. But it was found in the handwriting of Hafiz Abu Amir Abdari as "udaa" with fatha on both the dal and the ayn, making Ziyad the subject of the verb. This also has a valid interpretation, in the sense that Muawiya claimed him and Ziyad confirmed it, so Ziyad became one who claimed that he was the son of Abu Sufyan. And Allah knows best.Nawawi said this in Sharh Sahih Muslim.