كتاب الصلاة
4  
The Book of Prayers
(21)
Chapter: If The Imam Experiences An Excuse, From Illness, Or Travelling, Etc. He May Appoint Someone Else To Lead The People In Prayer; The One Who Offers Prayer Behind The Imam Sitting Because He Is Unable To Stand Must Stand If He Is Able To Do So; And The Abrogation Of Sitting Behind A Sitting Imam For Those Who Are Able To Stand
(21)
باب اسْتِخْلاَفِ الإِمَامِ إِذَا عَرَضَ لَهُ عُذْرٌ مِنْ مَرَضٍ وَسَفَرٍ وَغَيْرِهِمَا مَنْ يُصَلِّي بِالنَّاسِ وَأَنَّ مَنْ صَلَّى خَلْفَ إِمَامٍ جَالِسٍ لِعَجْزِهِ عَنِ الْقِيَامِ لَزِمَهُ الْقِيَامُ إِذَا قَدَرَ عَلَيْهِ وَنَسْخِ الْقُعُودِ خَلْفَ الْقَاعِدِ فِي حَقِّ مَنْ قَدَرَ عَلَى الْقِيَامِ
Sahih Muslim 418 d

'A'isha, the wife of the Messenger of Allah (ﷺ), said:

I tried to dissuade the Messenger of Allah (ﷺ) from it (i. e. from appointing Abu Bakr as the Imam.) and my insistence upon it was not due to the fact that I entertained any apprehension in my mind that the people would not love the man who would occupy his (Prophet's) place (i. e. who would be appointed as his caliph) and I feared that the people would be superstitious about one who would occupy his place. I, therefore, desired that the Messenger of Allah (ﷺ) should leave Abu Bakr aside in this matter.
حَدَّثَنَا عَبْدُ الْمَلِكِ بْنُ شُعَيْبِ بْنِ اللَّيْثِ، حَدَّثَنِي أَبِي، عَنْ جَدِّي، حَدَّثَنِي عُقَيْلُ بْنُ خَالِدٍ، قَالَ قَالَ ابْنُ شِهَابٍ أَخْبَرَنِي عُبَيْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ بْنِ عُتْبَةَ بْنِ مَسْعُودٍ، أَنَّ عَائِشَةَ، زَوْجَ النَّبِيِّ صلى الله عليه وسلم قَالَتْ لَقَدْ رَاجَعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم فِي ذَلِكَ وَمَا حَمَلَنِي عَلَى كَثْرَةِ مُرَاجَعَتِهِ إِلاَّ أَنَّهُ لَمْ يَقَعْ فِي قَلْبِي أَنْ يُحِبَّ النَّاسُ بَعْدَهُ رَجُلاً قَامَ مَقَامَهُ أَبَدًا وَإِلاَّ أَنِّي كُنْتُ أَرَى أَنَّهُ لَنْ يَقُومَ مَقَامَهُ أَحَدٌ إِلاَّ تَشَاءَمَ النَّاسُ بِهِ فَأَرَدْتُ أَنْ يَعْدِلَ ذَلِكَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَنْ أَبِي بَكْرٍ ‏.‏
Reference : Sahih Muslim 418d
In-book reference : Book 4, Hadith 101
USC-MSA web (English) reference : Book 4, Hadith 835
  (deprecated numbering scheme)