Sahih Muslim , Hadith 1888

It has been narrated on the authority of Abu Sa'id Khudri that a man came to the Prophet (may peace he upon him) and said: Who is the best of men? He replied: A man who fights in the way of Allah spending his wealth and staking his life. The man then asked: Who is next to him (in excellence)? He said: Next to him is a believer who lives in a mountain gorge worshipping hid Lord and sparing men from his mischief.

حَدَّثَنَا مَنْصُورُ بْنُ أَبِي مُزَاحِمٍ، حَدَّثَنَا يَحْيَى بْنُ حَمْزَةَ، عَنْ مُحَمَّدِ بْنِ الْوَلِيدِ الزُّبَيْدِيِّ، عَنِ الزُّهْرِيِّ، عَنْ عَطَاءِ بْنِ يَزِيدَ اللَّيْثِيِّ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، أَنَّ رَجُلاً، أَتَى النَّبِيَّ صلى الله عليه وسلم فَقَالَ أَىُّ النَّاسِ أَفْضَلُ فَقَالَ ‏"‏ رَجُلٌ يُجَاهِدُ فِي سَبِيلِ اللَّهِ بِمَالِهِ وَنَفْسِهِ ‏"‏ قَالَ ثُمَّ مَنْ قَالَ ‏"‏ مُؤْمِنٌ فِي شِعْبٍ مِنَ الشِّعَابِ يَعْبُدُ اللَّهَ رَبَّهُ وَيَدَعُ النَّاسَ مِنْ شَرِّهِ ‏"‏ ‏.‏

sunnah.com

It has been narrated (through a diferent chain of transmetters) on the same authority (i. e. Abu Sa'id Khadri) who said: A man asked: Messenger of Allah, which of men is the best? He said: A believer who fights staking his life and spending his wealth in the way of Allah. He asked: Who is next to him (in excellence)? He said: Next to him is a man who lives an isolated life in a mountain gorge, worshipping his Lord and sparing men from his mischief.

حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، أَخْبَرَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، عَنِ الزُّهْرِيِّ، عَنْ عَطَاءِ، بْنِ يَزِيدَ اللَّيْثِيِّ عَنْ أَبِي سَعِيدٍ، قَالَ قَالَ رَجُلٌ أَىُّ النَّاسِ أَفْضَلُ يَا رَسُولَ اللَّهِ قَالَ ‏"‏ مُؤْمِنٌ يُجَاهِدُ بِنَفْسِهِ وَمَالِهِ فِي سَبِيلِ اللَّهِ ‏"‏ ‏.‏ قَالَ ثُمَّ مَنْ قَالَ ‏"‏ ثُمَّ رَجُلٌ مُعْتَزِلٌ فِي شِعْبٍ مِنَ الشِّعَابِ يَعْبُدُ رَبَّهُ وَيَدَعُ النَّاسَ مِنْ شَرِّهِ ‏"‏ ‏.‏

sunnah.com

A version of the tradition narrated on the authority of Ibn Shihab has a little differently worded ending. i. e." A man in a mountain valley." but did not mention" next to him a man who...."

وَحَدَّثَنَا عَبْدُ اللَّهِ بْنُ عَبْدِ الرَّحْمَنِ الدَّارِمِيُّ، أَخْبَرَنَا مُحَمَّدُ بْنُ يُوسُفَ، عَنِ الأَوْزَاعِيِّ، عَنِ ابْنِ شِهَابٍ، بِهَذَا الإِسْنَادِ فَقَالَ ‏"‏ وَرَجُلٌ فِي شِعْبٍ ‏"‏ ‏.‏ وَلَمْ يَقُلْ ‏"‏ ثُمَّ رَجُلٌ ‏"‏ ‏.‏

sunnah.com