Shaykh Ibn Uthaymeen was asked:

Question:

When is hugging performed? What is its description? Does it occur when bidding a traveler farewell? Is it legislated?

Answer:

“The meaning of hugging in origin is the meeting of two necks. It is taken from the word neck (العنق). It is when the neck of this one [person] crosses the neck of this one [another person]. It is the affair which follows the custom. If it creates love, then it is done. Otherwise, it is left off. The people today usually hug when meeting after travels and also when bidding farewell [before] travels. It is an affair which is in accordance to custom”.

[Reference]

Translated by

Faisal Ibn Abdul Qaadir Ibn Hassan
Abu Sulaymaan