Cat aggression towards people usually has to do with lack of socialization with humans or traumatic experience with humans in the past such as abuse. Cats can remember things for a long time especially trauma. If a cat gets injured by a door when it's shut by accident, she will remember it and whenever she sees a door, she may associate it to the pain she once experienced and thus run away from it.
If your cat is usually pretty placid and all of a sudden acts really aggressive towards people, it could underline a possible medical condition. You can check with your vet to rule out any medical illness.
Punishing your cat for her aggression can be counter-productive and can intensify the aggression and fear. The best way to deal with aggression or agitation in cats is to apply positive reinforcement.
Since most aggression towards people stems from lack of trust in human beings, we can start helping the cat by familiarizing her with human scent since cats use their smell to identify objects and their whereabouts. You can achieve that by allowing the cat to inspect a person through sniffing. During the exploring process, do not interrupt. You can allow the person to point an index finger at the cat and let the cat sniff it. The person should not pet the cat until she starts rubbing her face against the finger, leaving her own scent on the human finger to indicate "we are good now". If your cat is not comfortable being too close to a stranger, try having the person stand further away from her at the beginning. Reward your cat with her favorite treat if she stays calm with the person around. Once your cat is ready, you can have the person move a step closer and see if your cat can continue to stay calm. Reward your cat again if successful. When you realize the person might be too close to the cat because your cat is acting out aggressively, ask the person to avert eye contact from the cat or even turn around, but do not step back. In the meantime, soothe your cat by talking to her in a soft tone. As soon as your cat calms down, offer her a treat.
Always reward your cat when she is doing well. Soon your cat will learn that by meeting people, she will be rewarded, which puts a new perspective in her that interacting with humans is positive and rewarding.
It requires a LOT of patience and consistency to train a distrustful cat to become more friendly towards people. With positive reinforcement, you can achieve that. However, in order to make it work, we have to stay calm throughout the entire process because if we lose our patience or become frustrated, our cat may mirror our behavior.