´It was narrated that Abu Hurairah said:` The Messenger of Allah said: "If you cannot find anywhere (for prayer) except sheep's resting-places and camels' resting-places, then perform prayer in the sheep's resting-places and do not perform prayer in the camels' resting-places."
Hadith Referenceسنن ابن ماجه / كتاب المساجد والجماعات / 768
Benefit: There is wisdom in this: if a goat tries to butt (with its horns, etc.), the person praying can control it, and there is no danger to his life. However, if a camel becomes mischievous, it is much more difficult to control, and if it suddenly attacks, there is even a danger to one's life. Nevertheless, the Messenger of Allah (sallallahu alayhi wa sallam) did pray facing a seated camel. See: (Sahih al-Bukhari, Book of Prayer, Chapter: Praying towards a riding animal, camel, tree, or saddle, Hadith: 507)
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 768
´Abu Hurairah narrated that :` Allah's Messenger said: "Perform Salat in sheep pens but do not perform Salat in the camels' resting area."
Shaykh Dr. Abdur Rahman Freywai
1: In “Pray in the sheepfolds” (صَلُّوافِيمَرَابِضِالْغَنَمِ), the command is for permissibility, meaning it is allowed and permissible to pray in the enclosures of sheep; you may perform prayer there. And in “Do not pray in the camel enclosures” (وَلاَتُصَلُّوافِيأَعْطَانِالإِبِلِ), the prohibition is one of forbiddance (tahrimi), meaning it is unlawful (haram).
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 348