How to great each other in accordance with Halacha? I mean can you hug? or no? What about if man and woman are greeting?
Because of the sanctity of marriage in Judaism, men and women who are not married, do not have friendly physical contact, not even shaking hands, but rather it's accepted to smile and bow slightly in mutual respect. In certain cases, if the other person doesn't know Jewish religious law, and puts out their hand to shake, and it would cause public embarrassment (which is also prohibited) not to shake their hand, some halachic authorities allow to shake their extended hand, so as not to humiliate them in public (unless the situation leaves room for explanation of the Jewish law, which will be understood by all those around, and will alleviate the embarrassment). Men can shake hands, hug or kiss men (obviously not on the lips!), and women to women, according to local custom and manners. It is not considered respectful, even for a man to hug or kiss a respected rabbi, unless they are personally already close, but the Sephardic Jews from Oriental communities will often respectfully kiss the hand of great rabbis.