Abdullah bin Maqil reported,

I sat with Kaab bin Ujra in this mosque, meaning the mosque of Kufa, and asked him about the ransom of fasting. He said, "I was carried to the Prophet ﷺ while lice were falling onto my face."The Prophet ﷺ said, "I did not think the hardship had reached this point with you. Can you find a sheep?"I replied, "No."He said, "Then fast three days, or feed six poor people, giving each poor person half a saa of food, and shave your head."So the verse was revealed concerning me specifically, but it applies to all of you generally.

Bukhari 4517

Sahih

حدثنا آدم حدثنا شعبة عن عبد الرحمن بن الأصبهاني قال سمعت

عبد الله بن معقل قال

قعدت إلى كعب بن عجرة في هذا المسجد يعني مسجد الكوفة فسألته عن فدية من صيام فقال حملت إلى النبي ﷺ والقمل يتناثر على وجهي فقال ما كنت أرى أن الجهد قد بلغ بك هذا أما تجد شاة قلت لا قال صم ثلاثة أيام أو أطعم ستة مساكين لكل مسكين نصف صاع من طعام واحلق رأسك فنزلت في خاصة وهي لكم عامة

البخاري 4517صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying, "Whoever among you is sick or has an ailment of his head"
Numbering
Darussalam 4517
Bukhari 4517