I've seen posts from others here who say they've done it and it is effective at keeping people away.
My bees in their present state show no aggression at all, but probably will get more defensive as they build up. If you just wanted deterrence but no danger, empty hive bodies, sealed so swarms don't move in, with something inside making a buzzing noise, ought to do the job.
Ours are in our front yard near the driveway, in a fenced enclosure. There's a bee crossing sign on the driveway before you get to them. No doubt this would keep some people away, but we're way out in the country with neighbors who are not scared of much.
Love us, love our bees. And snakes. And etc.