Alqamah bin Qays al-Nakha'i (may Allah have mercy on him) narrates: "I was with Sayyiduna Ibn Mas'ud (may Allah be pleased with him) while he was with Sayyiduna Uthman (may Allah be pleased with him). Sayyiduna Uthman (may Allah be pleased with him) said to him: 'How much desire for women is left in you now?' Alqamah (may Allah have mercy on him) said: When women were mentioned, Sayyiduna Ibn Mas'ud (may Allah be pleased with him) said: 'O Alqamah, come closer.' Alqamah (may Allah have mercy on him) said: At that time I was a young man. Then Sayyiduna Uthman (may Allah be pleased with him) said: 'The Messenger of Allah (peace and blessings be upon him) came out to a group of young men from the Muhajirun and said: "Whoever among you has the means should marry, for it lowers the gaze more and guards the private parts better; and whoever does not find the means (to marry) should fast, for fasting is a shield (that breaks desire) for him."'"
Imam Ahmad (may Allah have mercy on him) narrated it in the same way in his "Musnad".
And Imam al-Nasa'i (may Allah have mercy on him) narrated it through Amr bin Zurarah from Isma'il bin Ibrahim.
Imam Yahya bin Ma'in (may Allah have mercy on him) was asked about the hadith of Abu Ma'shar and he said: "It is a mistake; al-A'mash differed with him."
And Imam al-Daraqutni (may Allah have mercy on him) was asked about it and he said: "Abu Ma'shar Ziyad bin Kulayb narrates it from Ibrahim, from Alqamah, and Yunus bin Ubayd, Khalid al-Hadhdha' and Sa'id bin Abi Arubah narrated it from him; but Mansur, al-A'mash, Abu Hamzah, Hammad bin Abi Sulayman, al-Mughirah and al-Hasan bin Ubaydullah differed with him, and all of them narrated it from Ibrahim, from Alqamah, from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him). What is preserved (mahfuz) is that it is from Sayyiduna Ibn Mas'ud (may Allah be pleased with him), and Abu Ma'shar was not corroborated in his saying 'from Uthman' (may Allah be pleased with him)."
Related hadith on this topic