Hadithcore
Sahih al-Bukhari, 6926
sahih

Narrated Anas bin Malik:

A Jew passed by Allah's Messenger (ﷺ) and said, "As-Samu 'Alaika." Allah's Messenger (ﷺ) said in reply, "We 'Alaika." Allah's Messenger (ﷺ) then said to his companions, "Do you know what he (the Jew) has said? He said, 'As-Samu 'Alaika.'" They said, "O Allah's Messenger (ﷺ) ! Shall we kill him?" The Prophet, said, "No. When the people of the Book greet you, say: 'Wa 'Alaikum.'"

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

References2 variants
In-Book Reference
Book 88, Hadith 8
USC-MSA web (English) reference
Vol. 9, Book 84, Hadith 60 (deprecated numbering scheme)