Most dogs will experience a couple of fear periods during their development. One in puppyhood shortly after you bring them home between the age of 9 & 16 weeks. The other during adolescence at around 18 months old. For some dogs, it's not really a big deal. I barely noticed it for two of my past puppies. However, my dog Walker's secondary fear period has been quite noticable. Which sets me to wondering if it's just a fear period. I was laid up last year during most of his early developmental stages and he didn't get as much socialization as I would have liked. He tends to be skittish around some new people we meet in public. Since he's nearing the 18 month mark, he should be on his way out of the short fear period, which makes me think it's more a lack of early experiences that is causing some of his fear. In any case, no matter which is to blame, we are working on spending a lot of time around new people and places in positive ways to help him overcome whichever thing he's experiencing.
Here's the how to, if you've found yourself in the same situation. First, don't force your dog to greet anyone that he's shy around. Ask the person to stand still ( I say stand because some people will want to kneel down to the dog's level. A big no no in my opinion), keeping their hands at their sides so that your dog can choose whether or not she wants to sniff them. If she does approach them, they should just stand still until it's evident that she is comfortable being near them. In other words, she relaxes her body, licks their hands, maybe wags her tail. You can give them a treat to feed to her or if she won't take it from their hand ask them to just drop it on the ground for her to find. Don't make her linger there all day. Once the treat has been given, thank them and walk away. Keeping the interaction short after her initial shyness will help her bounce back more quickly. You may notice that she does a whole body shake off after. That's a good indication to you that the greeting was a bit stressful for her. Follow up any greetings of stranger's with lots of food rewards and time to sniff around in her environment. Lowering her head to sniff the gound will have a calming effect on her. Notice how many times she shakes off. She's pressing her "re-set" button to get herself back to a more comfortable state of mind. Don't be affraid to talk people through how you'd like the meeting to go. It's your dog after all. Furthermore, you don't have to let anyone greet your dog if you don't think it will go well. My dog Mike is never allowed to greet people that he doesn't know because he's affraid of new people and in the past has nipped at outstretched fingers. My stratedgy for a non greeting is to start working with my dog as people approach. Talking to him, asking him to heel and watch me as we pass. And not making eye contact with the would be greeter as they approach. People are pretty good at taking social cues from other humans.
How do you get your fearful dog to the point of wanting to greet people? Slowly, in his own time, in small doses. Take your dog to a place where you can see lots of people from a distance. Use the car as your safe place. Sit in the car with your dog in a supermarket parking lot. Reward him for watching people come and go. If he barks or reacts negetively to passing people, move your car further away so that he can still see but not react to passersby. I would only spend about 5 - 10 minutes doing this the first time out. If you're dog is less fearful, you can take him/her on foot to a moderatley busy area or street or park and just sit with them someplace where he can see the goings on but not be forced to interact with anyone. Lots of high value rewards and he will start to think...people = yummy food, and his fear should slowly change to tolerance to comfort around new people. Don't rush him. Patience now, will pay off later when he understands that you've got his back and he can choose whether or not he wants to greet someone.
This information barely scratches the surface and should be considered just a starting point to helping your dog deal with uncomfortable situations. It should be helpful if your dog in going through a normal developmental fear period. However, if your dog is already an adult or has a strong negetive reaction to people or other dogs everytime they see them, please contact me for further help and instruction. There's a lot that happens to our dogs internally as they experience really frighenting situations that may take a lot of counterconditioning and desensitizing to fix.