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)
حَدَّثَنَا رَسُولُ اللهِ ﷺ حَدِيثًا طَوِيلًا عَنِ الدَّجَّالِ قَالَ فَكَانَ فِيمَا حَدَّثَنَا قَالَ يَأْتِي وَهُوَ مُحَرَّمٌ عَلَيْهِ أَنْ يَدْخُلَ نِقَابَ الْمَدِينَةِ فَيَنْتَهِي إِلَى بَعْضِ السِّبَاخِ الَّتِي تَلِي الْمَدِينَةَ فَيَخْرُجُ إِلَيْهِ يَوْمَئِذٍ يَعْنِي رَجُلًا هُوَ خَيْرُ النَّاسِ أَوْ مِنْ خَيْرِ النَّاسِ فَيَقُولُ لَهُ أَشْهَدُ أَنَّكَ الدَّجَّالُ الَّذِي حَدَّثَنَا رَسُولُ اللهِ ﷺ حَدِيثَهُ فَيَقُولُ الدَّجَّالُ أَرَأَيْتُمْ إِنْ قَتَلْتُ هَذَا وَأَحْيَيْتُهُ أَتَشُكُّونَ فِي الْأَمْرِ؟ فَيَقُولُونَ لَا قَالَ فَيَقْتُلُهُ ثُمَّ يُحْيِيهِ فَيَقُولُ حِينَ يُحْيِيهِ وَاللهِ مَا كُنْتُ فِيكَ قَطُّ أَشَدَّ بَصِيرَةً مِنِّي الْآنَ فَيُرِيدُ الدَّجَّالُ أَنْ يَقْتُلَهُ فَلَا يُسَلَّطُ عَلَيْهِ