´Narrated Asma bint Yazid:` that the Messenger of Allah (ﷺ) passed through the Masjid one day, and a group of women were sitting, so he motioned his hand with the Salam - 'Abdul-Hamid (one of the narrators) gestured with his hand.
Hadith Referenceسنن ترمذي / كتاب الاستئذان والآداب عن رسول الله صلى الله عليه وسلم / 2697
Hadith Gradingالألبانی:ضعيف حجاب المرأة المسلمة (99 - 100)
1؎ : It is understood from this that where there is no fear of temptation (fitnah), it is permissible for men and women to greet each other with salam, for example, if there is a group of women or if the woman is elderly, because in both these cases there is no fear of temptation. However, for a man to greet a young woman when she is alone, or similarly for a young woman alone to greet a man, is not correct, because both these situations are not free from temptation.
Explanation & Benefits
Shaykh Dr. Abdur Rahman Freywai
Explanation: 1: It is understood from this that where there is no fear of temptation (fitnah), it is permissible for men and women to greet each other with salam. For example, if there is a group of women or an elderly woman, because in both these cases there is no fear of temptation. However, for a man to greet a young woman when she is alone, or similarly for a young woman alone to greet a man, is not correct, because both these situations are not free from temptation.
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 2697