My grandparents have a large garden at their house and grow tomatoes, peppers, and other things. Every summer, my grandmother and I can dozens of jars of spaghetti sauce and salsa. Sometimes, we even add cooked italian sausage to the spaghetti sauce. It always keeps for at least a year and we've never used any "magic" recipe to keep bacteria from growing. Your main goal should be to make sure everything is boiling hot and clean when you can.
You'll want to boil your jars and lids for about 20 minutes in clean water. Have your sauce simmering in another pot/pan. While wearing pot holders, use tongs to lift a glass out of the hot water, fill 2/3 full of sauce and then put the lid on and twist it about 1/2 way closed. In a few hours or so, the heat in the jars will create a vacuum and suck the lids down. Before you put them in your cupboards, press the top of each lid; if you hear a "pop", it's not canned and should be used within the week. We always do it in the evening and check them the next morning. Write the date canned (month/year) on top of each lid.
May God keep you safe in Afghanistan!