A study of the evidence from the Quran and hadith on not touching non-mahrams
Assalamualaikum I came across a hadith on Facebook which says that touching any non- mahram woman is harām. I wanted to ask if that Hadith is authentic, and if it is so, then to what extent does this rule apply in our life. I mean I have female relatives who are quite elder to me( 9 years and more) . Is it allowed to shake hands with them or hug them if in my heart I consider them to be like my mothers and sisters?
Alaikumassalam wa rahmatullah,
The most explicit hadith we have on the issue of touching the opposite sex is the following:
لأن يطعن في رأس أحدكم بمخيط من حديد خير له من أن يمس امرأة لا تحل له
It is better for one of you to pierce his head with an iron needle than to touch a woman for whom she is not halal.
Al-Tabarani
This hadith comes to us through Shaddad b. Saeed who is considered trustworthy but unreliable by many scholars, therefore this hadith is not guaranteed to be authentic and is therefore not relevant to this discussion.
The next hadith is one where the Prophet PBUH explicitly states that he does not shake women’s hands:
Muhammad bin Munkadir said that he heard Umaimah bint Ruqaiqah say:
Sunan Ibn Majah Vol. 4, Book 24, Hadith 2874 and others.
“I came to the Prophet (ﷺ) with some other women, to offer our pledge to him. He said to us: ‘(I accept your pledge) with regard to what you are able to do. But I do not shake hands with women.’”
The next hadith on touching non-mahrams is the following:
Aisha the wife of the Prophet, said, "Allah's Messenger (ﷺ) used to examine the believing women who migrated to him in accordance with this Verse: 'O Prophet! When believing women come to you to take the oath of allegiance to you… Verily! Allah is Oft-Forgiving Most Merciful.' (60.12) `Aisha said, "And if any of the believing women accepted the condition (assigned in the above-mentioned Verse), Allah's Messenger (ﷺ) would say to her. "I have accepted your pledge of allegiance." "He would only say that, for, by Allah, his hand never touched, any lady during that pledge of allegiance. He did not receive their pledge except by saying, "I have accepted your pledge of allegiance for that."
Sahih al-Bukhari Book 65, Hadith 4891; Sahih Muslim 1866 a; other collections
Below is a chain diagram of the hadith:

This hadith receives an authenticity score of 27.57%, making it close to the authentic mark of 30% according to our probabilistic hadith verification method.
The above appears to be all of the explicit evidence we have on the touching of non-mahrams.
Evidence from the hijab
However, another highly relevant area of evidence is that which applies to parts of the body that have to be covered. Naturally, if we are forbidden from looking at a certain part of a person’s body, we would also be forbidden from touching it. For the evidence on the rulings on which parts of the body should be covered see:
The purpose of hijab in IslamWhy the hijab is still obligatory (and why it is not only a vestige of 7th century Arabia)
Evidence from rules on privacy
The exception on shaking hands
Scholars such as Yusuf al-Qaradawi permit shaking the hands of the opposite sex when meeting non-Muslims in order to prevent humiliating them by refusing the handshake, since in such cases avoiding humiliating the person takes priority over the no-touching rule. Shaykh Yusuf al-Qaradawi mentions that while the Prophet PBUH never shook the hands of women, Umar [ra] did that, and Abu Bakr [ra] shook an old woman’s hands.
References:
IslamOnline fatwa that mentions al-Qaradawi’s opinion (Arabic PDF)