قال ابن القوطية: لما توفي المصعب بن عمران القاضي، استشار الأمير الحكم فيمن يستقضيه، فأجمع له وزراؤه وأعلام الناس، على محمد، بن بشير كاتب المصعب، وكان قد شهر عفافه واستقلاله بعهد المصعب، فولاه القضاء. فأثر على المصعب، وبعد في الفضل والعدل وصيته، وخلدت آثاره بعد. فلم يزل قاضيا إلى أن توفي فولي ابنه سعيد مكانه، قال ابن حارث: رأيت في بعض الكتب، أن ابن بشير لما وجه فيه، عدل في بعض طريقه إلى صديق له عابد، فنزل عليه، وتحدث معه في شأن نفسه، وتوقعه أنه وجه إليه في الكتابة التي قد تخلى عنها، فقال له صديقه: ما أرى بعث فيك إلا للقضاء. فقد مات قاضي قرطبة. فقال له ابن بشير: فإذا قبلتها فما ترى، فانصح لي وأشر علي. قال له العابد: أسألك عن ثلاثة أشياء فاصدقني فيها. كيف حبك لأكل الطيب، ولباس اللين، وركوب الغاره؟ فقال ابن بشير: والله ما أبالي ما رددت به جوعي، وسترت به عورتي، وحملت به رجلي، فقال هذه واحدة. فكيف حبك للوجوه الحسان وشبه هذا من الشهوات. فقال ابن بشير هذه حالة والله ما استشرقت نفسي إليها قط، ولا خطرت ببالي. قال: هذه ثانية. كيف حبك للمدح والثناء وكراهتك للعزل، وحب الولاية.
Ibn al-Qutiyya said: When al-Musʿab ibn ʿImran the judge died, the Amir al-Hakam sought counsel on whom to appoint as judge, and his viziers and the leading people agreed for him on Muhammad ibn Bashir, al-Musʿab's secretary, whose chastity and independence had become well known in al-Musʿab's time; so he appointed him to the judgeship. He outdid [?] al-Musʿab, his fame for merit and justice spread far, and his traces endured afterwards. He remained judge until he died, and his son Saʿid was appointed in his place. Ibn Harith said: I saw in some books that when Ibn Bashir was sent for, he turned aside on part of his way to a devout friend of his, stayed with him and talked with him about his own situation, expecting that he had been sent for about the secretaryship which he had given up. His friend said to him: I think you have been sent for only for the judgeship, for the judge of Qurtuba has died. Ibn Bashir said to him: If I accept it, what do you think? Give me sincere counsel and advise me. The devout man said to him: I will ask you about three things; tell me the truth about them. How is your love of eating fine food, wearing soft clothing and riding fine mounts [?]? Ibn Bashir said: By God, I do not care with what I repel my hunger, cover my nakedness and carry my feet. He said: This is one. How is your love of beautiful faces and similar desires? Ibn Bashir said: This is a state to which, by God, my soul has never aspired, nor has it crossed my mind. He said: This is the second. How is your love of praise and commendation, your dislike of dismissal, and your love of office?