I said: Messenger of Allah, from whom should we conceal our private parts and to whom can we show? He replied: conceal your private parts except from your wife and from whom your right hands possess (slave-girls). I then asked: Messenger of Allah, (what should we do), if the people are assembled together? He replied: If it is within your power that no one looks at it, then no one should look at it. I then asked: Messenger of Allah if one of us is alone, (what should he do)? He replied: Allah is more entitled than people that bashfulness should be shown to him. (Using translation from Abū Dāʾūd 4017)
قُلْتُ يَا رَسُولَ اللهِ عَوْرَاتُنَا مَا نَأْتِي مِنْهَا وَمَا نَذَرُ؟ قَالَ احْفَظْ عَوْرَتَكَ إِلَّا مِنْ زَوْجَتِكَ أَوْ مَا مَلَكَتْ يَمِينُكَ قَالَ قُلْتُ يَا رَسُولَ اللهِ فَإِذَا كَانَ الْقَوْمُ بَعْضُهُمْ فِي بَعْضٍ؟ قَالَ إِنْ اسْتَطَعْتَ أَنْ لَا يَرَاهَا أَحَدٌ فَلَا يَرَيَنَّهَا قُلْتُ فَإِذَا كَانَ أَحَدُنَا خَالِيًا؟ قَالَ فَاللهُ أَحَقُّ أَنْ يُسْتَحْيَا مِنْهُ