It is narrated from Sayyiduna Uthman bin Maz'un (may Allah be pleased with him) that he said: O Messenger of Allah, I am a man for whom this celibacy (living without a wife) during military expeditions is very hard; will you permit me to castrate myself, so that I may castrate myself? He (peace and blessings be upon him) said: "No; rather, O Ibn Maz'un, keep fasting, for it weakens desire."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 8288