Part of preparing for this future is being able to cache supplies in a manner that protects them from those who would take them. Because you're right, if people know you have resources then when shortages hit, it's going to be too tempting. Sooner or later somebody or some gang is going to make an attempt in them. You can't guarantee you can stand to multiple attacks.
It's better to stick up quietly, not brag about it, hide your supplies in separate caches, etc.
At the same time, you don't want to be a hoarder. That's bad too. You want to share with your neighbors. At some point, one of your prep strategies may fail and you will depend on them to help you smooth or fill the void. There's safety in community. There's energy and labor in community. True resilience will mean community. There is no other way.
So you've got to keep from falling into extremes, and you've got to walk that tightrope between protecting only yourself and developing resilient communities, especially when your sustainability community must exist within a broader community of people who will not participate in sustainable practices, take much more than they give without a second thought, and steal from you because they are entitled little pricks and are now desperate because they were irresponsible when it mattered most. Basically, your community of ants exists adjacent to a swarm of locusts.