It was narrated from Abu Salamah that Abu Hurairah said: "I said: 'O Messenger of Allah, I am a young man and I fear hardship for myself, but I cannot afford to marry; should I castrate myself?'" The Prophet turned away from him until he said it three times. Then the Prophet said: "O Abu Hurairah, the pen is dried concerning what you are going to face, so (it is up to you whether) you castrate yourself or not." Abu Abdur-Rahman (An-Nasai) said: Al-Awzai did not hear this narration from Az-Zuhri, and this hadith is sahih, Yunus reported it from Az-Zuhri.
قُلْتُ يَا رَسُولَ اللَّهِ إِنِّي رَجُلٌ شَابٌّ قَدْ خَشِيتُ عَلَى نَفْسِي الْعَنَتَ وَلاَ أَجِدُ طَوْلاً أَتَزَوَّجُ النِّسَاءَ أَفَأَخْتَصِي فَأَعْرَضَ عَنْهُ النَّبِيُّ ﷺ حَتَّى قَالَ ثَلاَثًا فَقَالَ النَّبِيُّ ﷺ يَا أَبَا هُرَيْرَةَ جَفَّ الْقَلَمُ بِمَا أَنْتَ لاَقٍ فَاخْتَصِ عَلَى ذَلِكَ أَوْ دَعْ قَالَ أَبُو عَبْدِ الرَّحْمَنِ الأَوْزَاعِيُّ لَمْ يَسْمَعْ هَذَا الْحَدِيثَ مِنَ الزُّهْرِيِّ وَهَذَا حَدِيثٌ صَحِيحٌ قَدْ رَوَاهُ يُونُسُ عَنِ الزُّهْرِيِّ