It is forbidden for a pilgrim, in a state of ihram, to shave or pluck, even a single hair of his, or another one's, hair, whether in ihram or not. There are three exceptions to this rule:
if there are plenty of lice on the body of the pilgrim and he is troubled by them;
if it becomes necessary to remove them, due to, for example, the length or quantity of hair that may cause headache, or for another reason;
if the hair drop off by themselves in the course of wudhu or ghusl.
If a pilgrim, in a state of ihram, shaves his head without any valid reason, the kaffarah is a sheep. If, however, he does so out of necessity, the penalty is either a sheep, fasting for three days, or feeding six poor persons, each receiving a kilo and a half of food.
If he removes the hair under the armpits, the kaffarah is a sheep; as a matter of precaution, that will also be the penalty, if he removes the hair under one armpit only. If he removes the hair of the beard, or any other hair, the kaffarah is feeding a poor person. There is no kaffarah for a pilgrim shaving the head of another person, irrespective of whether or not the other person is in a state of ihram.
There is no objection to a pilgrim, in a state of ihram, scratching his head or body, if no hair falls off or blood oozes. If the pilgrim strokes, without any reason, his head or beard, causing one or two hairs to drop off, he must give, in charity, some food. If this happens in the course of wudhu or similar act, there is no kaffarah on him.