Abdullah bin Haneen said: There was a disagreement between Sayyiduna Miswar bin Makhramah and Sayyiduna Abdullah bin Abbas (may Allah be pleased with them) regarding a Muhrim washing his head. So they sent me to Sayyiduna Abu Ayyub Ansari (may Allah be pleased with him) to ask him how he saw the Messenger of Allah (peace and blessings be upon him) wash his head while in the state of Ihram. So I went to Sayyiduna Abu Ayyub (may Allah be pleased with him), who was sitting between two wooden planks of a well, bathing behind a cloth screen. I greeted him with salam, so he lowered the screen. I said that your cousin Sayyiduna Ibn Abbas (may Allah be pleased with them both) has sent me to you (to ask) how you saw the Messenger of Allah (peace and blessings be upon him) wash his head while in the state of Ihram. So he passed both his hands over his head, moving them from the front to the back and from the back to the front.
Hadith Referenceسنن دارمي / من كتاب المناسك / 1831
In other narrations, it is mentioned that Sayyiduna Abu Ayyub radi Allahu anhu asked a man to pour water, so he poured water and then Abu Ayyub passed both his hands forward and backward over his head. From this, it is understood that washing the head in the state of ihram is permissible, but one should not rub the hair. Mawlana Dawud Raz rahimahullah writes under this hadith: Among the benefits of this hadith is that the noble Companions would debate with each other regarding issues of rulings, then refer back to the text (nass), and then accept a solitary report (khabar wahid) as well... End of Sharh Bukhari Sharif (1840).
In one narration, it is mentioned: Upon learning the ruling, Sayyiduna Miswar radi Allahu anhu said to Sayyiduna Ibn Abbas radi Allahu anhuma that now I will not dispute with you in any matter (in one narration: opposition). As in Muslim (1205).