Sayyiduna Ka'b bin 'Ujrah (may Allah be pleased with him) reports that the Messenger of Allah (ﷺ) passed by me at the place of Hudaybiyyah while I was kindling a fire under a cooking pot and lice were falling from my head. He (ﷺ) said: "O Ka'b! Have the lice caused you trouble?" Then he (ﷺ) said: "Shave your head and (as compensation) either sacrifice a sheep, or fast for three days, or feed six needy people with a measure of grain."
Hadith Referenceالسنن المأثورة / باب ما جاء في فدية الأذى / 447
Hadith Takhrijصحیح بخاری، المرضی، باب قول المريض انى وجع ...... الخ، رقم: 5665، صحیح مسلم، الحج، باب جواز حلق الرأس للمحرم اذا كان به اذی، رقم: 1201