Praise be to Allaah.
Al-Bukhaari narrated in al-Saheeh that Abu Hurayrah (may Allaah be pleased with him) said: “The Messenger of Allaah SAWS (peace and blessings of Allaah be upon him) said that Moosa (peace be upon him) was a very shy and modest man, and none of his skin was ever seen because he was so modest. So some of the Children of Israel annoyed him by saying, ‘He is only being so modest because he has some fault in his skin, such as leprosy, scrotal hernia, etc.’ Allaah wanted to demonstrate that he was free of what they were saying about him. One day Moosa went away by himself, put his garment on a rock and washed himself. When he had finished, he went to pick up his garment, and the rock ran away with it. Moosa picked up his stick and ran after the rock, saying, ‘My garment, O rock! My garment, O rock!’ Then he reached a group of the Children of Israel, who saw him naked and that he was the best that Allaah had created and the most free of the faults that they had spoken of. Then the rock stopped, so Moosa took his garment and struck the rock with his stick. By Allaah, there were marks left on the rock by his stick, three or four or five. This is what Allaah said (interpretation of the meaning): ‘O you who believe! Be not like those who annoyed Moosa (Moses), but Allaah cleared him of that which they alleged, and he was honourable before Allaah’ [al-Ahzaab 33:69].”
(Saheeh al-Bukhaari, 3404)
The scholars quoted this hadeeth as evidence that it is permissible to be naked when one is alone, especially if that is for a reason such as taking a bath. Most of the scholars regarded this as being permissible, as al-Haafiz said in al-Fath (1/385). Al-Bukhaari gave this chapter the title “Chapter on one who bathes naked when he is alone, although whoever covers himself, covering is preferable.” The fact that covering oneself is preferable is taken from the hadeeth which was narrated by the authors of Sunan and classed as hasan by al-Tirmidhi and as saheeh by al-Haakim, from Mu’aawiyah ibn Haydah, who said: “I said, ‘O Prophet of Allaah, when should we cover our ‘awrah and when may we uncover it?’ He said, ‘Protect (cover) your ‘awrah from everyone except your wife and those whom your right hand possesses (concubines).’ I said, ‘O Messenger of Allaah, what about when one of us is alone?’ He said, ‘Allaah is more deserving than the people that you should be modest before Him.’”
And Allaah is the Source of strength.