We have always told our daughter not to talk to strangers unless we give her permission to talk to them.
For example, if we are at the grocery store and someone says 'hello' to her. It's ok to say hello back, but only after her dad or I say it's alright to do so.
She is almost 10 and she is still cautious about who she speaks to. We were at a gathering a few weeks ago where we stayed at a hotel. The desk clerk said Hello to her and she wouldn't acknowledge him until I told her it was ok to do so. I then explained that she doesn't talk to strangers. He completely understood and knew she wasn't being rude.
Most people will be understanding if you let them know that your child isn't being rude by not talking to them. Just tell them that your child doesn't know them, therefore he won't speak to them without your permission.
Also be sure to talk to him about 'good touch and bad touch'. Kids are very intuitive. They know when something doesn't feel right.
Also, never force him hug or kiss someone he isn't comfortable with. Even if it's your favorite Aunt. Have adults ask his permission before they get a hug or kiss on the cheek from him. Tell them that if he refuses, that it's ok.
Many times kids are forced to give an Aunt, Uncle or whomever a hug even when they don't want to. Parents are afraid of offending family members so they force the kid to tolerate it.
This teaches the kids that the adult always is in control and has to be obeyed even if it doesn't feel right to them. It makes it easier for adults who are up to no good to get a kid to go along with what they want.
A child should be allowed to tell an adult 'no' in certain circumstances without being punished for it.
You have to teach him the difference in saying 'no; because something doesn't feel right and saying 'no' because he doesn't want to do something he should.