The Rambam wrote in the fourth chapter of Nahalot: One who had a maidservant and fathered a son from her, and was accustomed to treating him as a son, or said "he is my son and his mother is a freedwoman"—if he is a Torah scholar or a virtuous person who is scrutinized in the minutiae of the mitzvot, this son shall inherit from him. Nevertheless, he may not marry a daughter of Israel until he brings proof that his mother was freed and then gave birth, for she was established as a maidservant before us. But if he is of the rest of the commoners, and it goes without saying if he was of those who abandon themselves to such things, he remains with the status of a slave in every regard; his brothers from his father may sell him, and if his father has no son except for him, his father's wife must undergo yibbum. Thus far his words. Our teacher, the Beit Yosef, transcribed this in section 6. The Rambam wrote that this law appears to him to be from the principles of tradition. There is one who did not distinguish between virtuous people and the rest of the people except regarding the matter that his brothers may not sell him alone. And there is one who instructed that even regarding inheriting from him, we do not distinguish among Israel, and it is not proper to rely on this matter. Thus far his words. The explanation of his words is that there are some of the Geonim who said that this which we establish, that one who cohabits with a maidservant, the offspring is like her, this is regarding the maidservant of others; but with his own maidservant, we say that he certainly freed her and he is his son in every regard, whether for prohibition or for monetary matters. And there are some of the Geonim who are in doubt about this and ruled that we follow the stringency: regarding prohibition and monetary matters he does not inherit from him, for we do not extract money in a case of doubt, and the heirs cannot sell him; and if he wishes to marry a daughter of Israel he requires a writ of manumission, and if he betrothed a daughter of Israel she requires a get due to doubt, and if he wishes to marry a maidservant we do not allow him [the Rif, second chapter of Yevamot]. But the Rambam, of blessed memory, holds that we do not distinguish between one maidservant and another in an ordinary case, for even with his own maidservant we maintain his status as a certain slave. And so he wrote in the ninth chapter of Avadim: An Israelite who cohabits with a Canaanite maidservant, even though she is his maidservant, the offspring is a Canaanite in every regard; see there. Only regarding the matter of inheritance does he hold that since it is in his power to give his money to whomever he wishes, therefore if he is a Torah scholar or at least a virtuous person and behaves with him as a son, we rely on him regarding this matter by the reasoning of a migo. But regarding an am ha'aretz, he is not believed even with a migo in a place of a strong presumption such as this, where the mother has the status of a maidservant [the Maggid Mishneh]. Our teacher, the Rema, wrote that there are those who say she performs chalitzah and does not undergo yibbum. Thus far his words. For when his father has no other son besides him, where the opinion of the Rambam is that his legitimate wife even undergoes yibbum, he was concerned for the opinion of the Geonim for stringency, that perhaps he freed her and he is a complete son and exempts his father's wife from yibbum; see Even HaEzer siman 156. The opinion of the Tur is that regarding monetary matters, the burden of proof is on the claimant, and he does not inherit from his father, and the property remains in the possession of the rest of the heirs; and to this our teacher, the Rema, agreed.
כתב הרמב"ם בפ"ד מנחלות מי שהיה לו שפחה והוליד ממנה בן והיה נוהג בו מנהג בנים או שאמר בני הוא ומשוחררת היא אמו אם ת"ח הוא או אדם כשר שהוא בדוק בדקדוקי מצוה ה"ז יירשנו ואעפ"כ איננו נושא בת ישראל עד שיביא ראיה שנשתחררה אמו ואח"כ ילדה שהרי הוחזקה שפחה בפנינו ואם משאר הדיוטות הוא ואין צ"ל אם היה מהמפקירין עצמן לכך ה"ז כחזקת עבד לכל דבר ואחיו מאביו מוכרים אותו ואם אין לאביו בן חוץ ממנו אשת אביו מתיבמת עכ"ל והעתיקו רבינו הב"י בסעיף ו' וכתב הרמב"ם שזה הדין נ"ל מעקרי הקבלה ויש מי שלא חלק בין כשרים לשאר העם אלא לענין שלא ימכרוהו אחיו בלבד ויש מי שהורה שאפילו ליורשו לא נחלוק בישראל ואין ראוי לסמוך על דבר זה עכ"ל ביאור דבריו שיש מהגאונים שאמרו דהא דקיי"ל הבא על השפחה הולד כמותה זהו בשפחה של אחרים אבל בשפחתו אמרינן דודאי שיחררה ובנו הוא לכל דבר בין לאיסור בין לממון ויש מהגאונים שמסתפקים בזה ופסקו דאזלינן לחומרא באיסור ובממון אינו יורשו דאין מוציאין ממון מספק והיורשים אין יכולים למכרו ואם רוצה לישא בת ישראל צריך גט שחרור ואם קידש בת ישראל צריכה גט מספק ואם רוצה לישא שפחה אין מניחין לו [רי"ף פ"ב דיבמות] אבל הרמב"ם ז"ל ס"ל דאין לחלק בין שפחה לשפחה בסתמא דאפילו בשפחתו מחזקינן ליה כודאי עבד וכ"כ בפ"ט מעבדים ישראל שבא על שפחה כנענית אע"ג שהיא שפחתו הרי הולד כנעני לכל דבר ע"ש ורק לענין ירושה ס"ל דכיון דבידו לתת ממונו לכל מי שירצה לכן אם ת"ח או שלפחות הוא אדם כשר ומתנהג עמו כבן סומכין עליו לענין זה מטעם מיגו אבל בע"ה אינו נאמן אף במיגו במקום חזקה אלימתא כי האי שיש להאם חזקת שפחות [הה"מ] ורבינו הרמ"א כתב די"א דחולצת ולא מתיבמת עכ"ל דכשאין לאביו בן אחר חוץ ממנו שדעת הרמב"ם דאשתו הכשרה אף מתיבמת חשש לדעת הגאונים לחומרא דשמא שחררה והוי בן גמור ופוטר את אשת אביו מיבום וע' באהע"ז סי' קנ"ו ודעת הטור דלענין ממון הממע"ה ואינו יורש את אביו ונכסים בחזקת שארי היורשים עומדים ולזה הסכים רבינו הרמ"א: