If your water heater has been turned off or is set to a temperature below 140 degrees Fahrenheit, the sulfur smell is caused by sulfur-reducing bacteria living inside the water tank. The bacteria produce hydrogen sulfide, a foul-smell gas that can permeate your hot water.
You can kill sulfur-reducing bacteria by turning the temperature of your hot water heater up to 160 degrees, and leaving it there for eight hours. Drain the tank of water afterward to remove the affected water, then return the heat level to 140 degrees, according to the Nebraska Department of Health and Human Services.
You can reduce the risk of the return of the bacteria and the sulfur smell by keeping your water heater set to 140 degrees or above. To eliminate the risk completely, you will need to consult a plumbing professional about possible modifications to your water heater.