When you nod, you shake your head up and down, as if you're indicating agreement. If you want to say "Yes" without uttering a single word, all you have to do is nod.
There's the deliberate nod, when you agree with someone by raising and lowering your chin, and then there's the accidental nod — when you're so sleepy that your eyes close and your head dips down. You can even say you "nod off to sleep" in this case. If you know someone well enough to nod at them when you pass, but not well enough to stop and chat, you can call that person "a nodding acquaintance."