كتاب الحج
15  
The Book of Pilgrimage
(65)
Chapter: It is permissible to ride the sacrificial animal if necessary
(65)
باب جَوَازِ رُكُوبِ الْبَدَنَةِ الْمُهْدَاةِ لِمَنِ احْتَاجَ إِلَيْهَا ‏‏
Sahih Muslim 1322 c

Hammam b. Munabbih reported:

It is one out of these (narrations) that Abu Huraira (Allah be pleased with him) narrated to us from Muhammad the Messenger of Allah (ﷺ), and he narrated to us traditions out of which is that he said: When there was a person who was driving a garlanded sacrificial camel, Allah's Messenger (ﷺ) said to him: Woe to you; ride on it. He said: Messenger of Allah, it is a sacrificial animal, whereupon Allah's Messenger (ﷺ) said: Woe to you, ride on it; woe to you, ride on it.
حَدَّثَنَا مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، حَدَّثَنَا مَعْمَرٌ، عَنْ هَمَّامِ بْنِ مُنَبِّهٍ، قَالَ هَذَا مَا حَدَّثَنَا أَبُو هُرَيْرَةَ، عَنْ مُحَمَّدٍ، رَسُولِ اللَّهِ صلى الله عليه وسلم فَذَكَرَ أَحَادِيثَ مِنْهَا وَقَالَ بَيْنَمَا رَجُلٌ يَسُوقُ بَدَنَةً مُقَلَّدَةً قَالَ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ وَيْلَكَ ارْكَبْهَا ‏"‏ ‏.‏ فَقَالَ بَدَنَةٌ يَا رَسُولَ اللَّهِ ‏.‏ قَالَ ‏"‏ وَيْلَكَ ارْكَبْهَا وَيْلَكَ ارْكَبْهَا ‏"‏ ‏.‏
Reference : Sahih Muslim 1322c
In-book reference : Book 15, Hadith 414
USC-MSA web (English) reference : Book 7, Hadith 3048
  (deprecated numbering scheme)