Abdullah 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. He 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, half a saa of food for each, and shave your head.'So it was revealed concerning my particular case, but it applies to all of you in general."

Azami 11977

Sahih

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

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

الأعظمي 11977صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "And complete the Hajj and Umrah for Allah. But if you are prevented, then offer what can be obtained with ease of sacrificial animals. And do not shave your heads until the sacrificial animal has reached its place of slaughter. And whoever among you is ill or has an ailment of the head, then a fidya of fasting or charity or sacrifice. And when you are secure, then whoever performs Umrah followed by Hajj, offer what can be obtained with ease of sacrificial animals. And whoever cannot find one, then a fast of three days during the Hajj and seven when you return, those are ten complete days. That is for those whose family is not present at Masjid al-Haram. And fear Allah and know that"
Numbering
Jami al-Kamil 11977 (2nd edition)
Azami 11977