8 of 14 added 40 characters in body

Can a man hug or kiss a man?

There seems to be a custom that men hug (kiss) each other when they greet each other.
Are Jews permitted to do so? (does it matter if they are single?)

The idea that it might be forbidden came from these sources:

Shulchan Aruch 20:1

הבא על אחת מן העריות דרך איברים או שחבק ונשק ונהנה בקירוב בשר הרי זה לוקה וחשוד על העריות:
...or he hugged and kissed (one of the people with whom sexual relations are forbidden) or had pleasure from the nearness of the flesh, he receives lashes....

Shulchan Aruch 21:7

המחבק או המנשק אחת מהעריות שאין לבו של אדם נוקפו עליהם כגון אחותו הגדולה ואחות אביו וכיוצא בהם אע"פ שאין לו שום הנאה כלל הרי זה מגונה ביותר ודבר איסור הוא ומעשה טפשים שאין קרבים לערוה כלל בין גדולה בין קטנה חוץ מהאב לבתו ומהאם לבנה
To hug or kiss one of the arayos whom people do not normally lust after, such as his adult sister or his aunt or similar, even though he derives no pleasure at all, is very reprehensible, forbidden, and the act of a fool. This is because we do not come close to arayos at all, whether (female) adult or minor, except the father to his daughter and the mother to her son.

Aruch Hashulchan 20:18

כן אסור לאיש להתחכך לאיש באיבריו דרך תאוה
It is also forbidden for a man to rub another man on his limbs in a lustful way

Beer Haitiv 24:1

surely a single man must stay away from to sleeping together (on the same bed) with another single man (in privacy), and this behavior should be protested against


kissing might only be a problem if on the lips so this question is mainly regarding hugging
Rabainu Bechaya 29:11

...We should also note that Yaakov did not kiss Rachel on the mouth but on the head or the shoulder, suggesting that there was no sexual element in that kiss (Ibn Ezra)