I use canning jars for stuff I don’t want ruined. If you use the lids and screw them on snugly, then even though you are not processing the stuff, nothing can get in or out.
The only problem is that they break if dropped.
Salt is another thing to consider storing. I’d say it’s more necessary than sugar by far.
I don’t hear a lot of advice about making sure you have adequate salt, but it’s necessary for survival if someone is doing hard physical labor and sweats a lot.
I’d suggest putting the salt and anything else you want to store in containers on days with low humidity. That way, the stuff will be as dry as possible because once you seal the jar, it’s there for keeps.
If you can warm the jars and heat the lids and rings, they will contract and seal tightly when they cool. Not recommended for foods other than sugar or salt, of course...