Question: The people hug each other on the days of Eid and they are not returning from a travel. The time between it is short, the time of prayer, then they hug each other after Eid prayer. We hope from you a clarification [about this practice]?
Answer: We do not know of an origin for hugging [on the day of ‘Eid] except the custom of the people. What should be done is dua for acceptance [of the good deeds]… this is the guidance of the salaf. As for hugging because of ‘Eid or specifying it, then I do not know of any origin for it except for the custom of the people. What is better is to shake hands only. He meets [the Muslims] and says: May Allah guide you on this Eid or May Allah bless you on this Eid or May Allah accept from me and you. What is like that. There is no harm.
[Taken from: Fatawa Jaami’ al-Kabeer in Riyaad, second collection found here: https://www.islamhouse.com/media.php?f=151896 ]
Faisal ibn Abdul Qaadir Ibn Hassan