I was with Abdullah bin Masud at Mina when Uthman met with him privately, so I sat nearby.Uthman said to him, "Would you like me to marry you to a young virgin girl who might remind you of something of your past vigor?"When Abdullah saw that Uthman had no other need than this, he motioned to me with his hand, so I came over, and he was saying, "If you say that, the Messenger of Allah ﷺ said, 'Young men, whoever among you is able to marry should do so, for it lowers the gaze and guards the private parts. And whoever is not able should fast, for it will be a shield for him.'"
حدثنا عبد الله بن عامر بن زرارة حدثنا علي بن مسهر عن الأعمش عن إبراهيم
كنت مع عبد الله بن مسعود بمنى فخلا به عثمان فجلست قريبا منه فقال له عثمان هل لك أن أزوجك جارية بكرا تذكرك من نفسك بعض ما قد مضى فلما رأى عبد الله أنه ليس له حاجة سوى هذه أشار إلي بيده فجئت وهو يقول لئن قلت ذلك لقد قال رسول الله ﷺ يا معشر الشباب من استطاع منكم الباءة فليتزوج فإنه أغض للبصر وأحصن للفرج ومن لم يستطع فعليه بالصوم فإنه له وجاء
Bukhari narrated it in the Book of Fasting, chapter "Fasting for the one who fears celibacy for himself," hadith no. 1905, 5065, and Muslim narrated it in the Book of Marriage, chapter "The recommendation of marriage for one whose soul longs for it and who finds the means," etc., hadith no. 1400, from the hadith of Amash, with the same chain.