How do I stop my settlers stealing my weapons and armour?
There are still a few options; Keep your best equipment and power armor in a depopulated settlement, such as Red Rocket truck stop. If you haven't sent settlers there, then settlers can't steal your equipment. Raiders may still be able to steal your things, but that's what all the turrets are for, right? ;)
Alternately, find a safe connected to a terminal, drop your stuff in it, and lock it. This has the downside that you'll have to travel back to wherever the terminal-safe was. And even if you can find or somehow create one in a settlement, settlers that have the hacking or lock-picking skill might still be able to get at your things.
Optionally, keep all your things in a region of the map inaccessible to settlers, such as a rooftop or closed-off upper floor with a welcome mat. This ensures that you can fast-travel to the area, while your settlers won't be able to reach it.
use Home Plate (within Diamond City) for your house/abode/safe/etc. Buy it from the mayor's receptionist for 2,000 caps. No settlers, no companions unless they are with you, and no npc's; plus, you zone in at the front door INSIDE -- teleporting out is allowed to anywhere that's open on your map.
yes, the npc's/settlers/non-player-beings take even the Legendary weapons from workshops/benches/containers, plus the ammo to go with it.
I'm going to nuke Sanctuary Hills (so help me God!) because of all the stealing going on in that place--armor, weapons, ammo, FOOD (sometimes) too! All I need to do is finish cleaning it completely out, construct artillary, use the smoke bombs to aim, and BOOM!
So far the comments and answer are concentrating on the "settlers take things from containers" part of the question, but I'm also trying to ensure a settler won't get in power armour if they have a fusion core already. After I got stung by this and got my armour back I went round all 20 settlers at Sanctuary Hills and found a second settler who was walking around with a fusion core in their pocket (as well as the first one who got in the armour and I pickpocketed the core back from).
My current solution is to build a fence around my armour, and when I want to access it I go into Workshop Mode, click on a piece of fence as if to move it, walk forward through the gap, then cancel, so the piece of fence goes back where it was. This works, but is a bit annoying.
I read somewhere else you can build an elevated platform (using the shack foundations) that can only be reached by jumping, which apparently works because settlers can't jump. I might have to move my armour (it's currently indoors where the power armour frame starts in Sanctuary, and the roof is too low to let me jump over the fence).