From tying a garland of garlic to stringing up lime and chilly, different communities around the world suggest different ways to ward off ghosts. Please note that these are method suggested for keeping ghosts away. Ghosts can be harmless or evil. Here is a small list of ways for protection from ghosts and evil spirits as per Indian tradition.
An interesting situation that can be hypothesized on the basis of testimonials from subjects who have undergone demonic possession or witnessed it in another person directly.