I have this problem.
I'll often know people by a face and a name without realizing the two belong to eachother.
I took great pleasure once in working with an older gentleman who was a television and film actor because he had "friends" who had known him for decades and he did not know who they are. Presumably because of his memory and because he knew so many people.
But he did greet them pleasantly and seemed to reciprocate whatever warmth people showed towards him. He confessed to me that he didn't know any of the people but that he didn't want to hurt them.
He didn't lie to anyone but he did smile and nod when people identified him as an old friend.
This is generally what I try to do.
I generally trust that I know someone if they claim to know me and while I won't pretend to remember anything about them, I will shake hands, smile and nod.
I'm bad at small talk as I've developed "autopilot" routines which frequently go in circles or lead to inappropriate responses.
But I don't want to hurt people who find value in being recognized or who want perceived admiration/friendship reciprocated.
I try to treat NTs as I believe they want to be treated. I'll fake laughs or smiles or facial responses that I've had to practice in the mirror for years. I don't do this to be deceptive but to be genuine.
So often, NTs seem to feel slighted, hurt or angry when small talk, recognition or affection are not reciprocated. So I try to return whatever I get in kind.
It's been awkward learning to hug and shake hands with people, often people who I do not recognize. But since my intent is not to show unkindness towards them, I find that what works for me is to imagine myself in a strange, primitive culture where I have been treated graciously by a host with unusual customs.
I would attempt to observe the bows in Japan or the hand gestures in Italy if traveling abroad... and so I attempt not to offend in NT culture by acting reciprocally. I smile at people who smile. I wink at people when I make a bad joke. I force a laugh when I find something intended to be funny.
And as a matter of respect, I try not to look as though I don't recognize people who talk to me. I will eventually ask for their name if I have to but it seems easier on them not to acknowledge that I have no memory of ever seeing them before, even when they can point to dozens of meetings we've had before.
And frequently, I blank on close friends' or regular acquaintances' names. So it isn't intended as a slight on my part when I forget people. The trick for me is trying to keep the other person from receiving the wrong message.