He would come but would not be allowed to enter the mountain passes to Medina. So he will alight at some of the barren tracts near Medina, and a person who would be the best of men or one from amongst the best of men would say to him: I bear testimony to the fact that you are Dajjal about whom Messenger of Allah ﷺ had informed us. The Dajjal would say: What is your opinion if I kill this (person), then I bring him back to life; even then will you harbour doubt in this matter? They would say: No. He would then kill (the man) and then bring him back to life. When he would bring that person to life, he would say: By Allah, I had no better proof of the fact (that you are a Dajjal) than at the present time (that you are actually so). The Dajjal would then make an attempt to kill him (again) but he would not be able to do that. Abu Ishaq reported that it was said: That person would be Khadir (Allah be pleased with him). (Using translation from Muslim 2938a)
حَدَّثَنَا رَسُولُ اللهِ ﷺ حَدِيثًا طَوِيلًا عَنِ الدَّجَّالِ فَقَالَ فِيمَا يُحَدِّثُنَا قَالَ يَأْتِي الدَّجَّالُ وَهُوَ مُحَرَّمٌ عَلَيْهِ أَنْ يَدْخُلَ نِقَابَ الْمَدِينَةِ فَيَخْرُجُ إِلَيْهِ رَجُلٌ يَوْمَئِذٍ هُوَ خَيْرُ النَّاسِ أَوْ مِنْ خَيْرِهِمْ فَيَقُولُ أَشْهَدُ أَنَّكَ الدَّجَّالُ الَّذِي حَدَّثَنَا رَسُولُ اللهِﷺ حَدِيثَهُ فَيَقُولُ الدَّجَّالُ أَرَأَيْتُمْ إِنْ قَتَلْتُ هَذَا ثُمَّ أَحْيَيْتُهُ أَتَشُكُّونَ فِي الْأَمْرِ فَيَقُولُونَ لَا فَيَقْتُلُهُ ثُمَّ يُحْيِيهِ فَيَقُولُ حِينَ يَحْيَا وَاللهِ مَا كُنْتُ قَطُّ أَشَدَّ بَصِيرَةً فِيكَ مِنِّي الْآنَ قَالَ فَيُرِيدُ قَتْلَهُ الثَّانِيَةَ فَلَا يُسَلَّطُ عَلَيْهِ