Ibn Abi Najih (may Allah have mercy on him) said: A man passed by the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) asked: "Who knows him?" A man said: I know him by his face, but I do not know his name. He (peace and blessings be upon him) said: "That is not knowing him."
This mursal version is the correct one.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20399