كتاب الزهد والرقائق
55  
The Book of Zuhd and Softening of Hearts
(8)
Chapter: The Prohibition Against Disclosing One's Own Sins
(8)
باب النَّهْىِ عَنْ هَتْكِ الإِنْسَانِ، سِتْرَ نَفْسِهِ
Sahih Muslim 2990

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

All the people of my Ummah would get pardon for their sins except those who publicise them. And (it means) that a servant should do a deed during the night and tell the people in the morning that he has done so and so, whereas Allah has concealed it. And he does a deed during the day and when it is night he tells the people, whereas Allah has concealed it. Zuhair has used the word hijar for publicising.
حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، وَمُحَمَّدُ بْنُ حَاتِمٍ، وَعَبْدُ بْنُ حُمَيْدٍ، قَالَ عَبْدٌ حَدَّثَنِي وَقَالَ، الآخَرَانِ حَدَّثَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا ابْنُ أَخِي ابْنِ شِهَابٍ، عَنْ عَمِّهِ، قَالَ قَالَ سَالِمٌ سَمِعْتُ أَبَا هُرَيْرَةَ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏"‏ كُلُّ أُمَّتِي مُعَافَاةٌ إِلاَّ الْمُجَاهِرِينَ وَإِنَّ مِنَ الإِجْهَارِ أَنْ يَعْمَلَ الْعَبْدُ بِاللَّيْلِ عَمَلاً ثُمَّ يُصْبِحُ قَدْ سَتَرَهُ رَبُّهُ فَيَقُولُ يَا فُلاَنُ قَدْ عَمِلْتُ الْبَارِحَةَ كَذَا وَكَذَا وَقَدْ بَاتَ يَسْتُرُهُ رَبُّهُ فَيَبِيتُ يَسْتُرُهُ رَبُّهُ وَيُصْبِحُ يَكْشِفُ سِتْرَ اللَّهِ عَنْهُ ‏"‏ ‏.‏ قَالَ زُهَيْرٌ ‏"‏ وَإِنَّ مِنَ الْهِجَارِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2990
In-book reference : Book 55, Hadith 68
USC-MSA web (English) reference : Book 42, Hadith 7124
  (deprecated numbering scheme)