The skin flora ought to be able to prevent harmful bacteria from setting up home, and causing an infection. It is thought that regularly moisturising is important, and that possibly harmful bacteria are more likely to colonise dry skin. It has been shown that the microbiome of those people with eczema and psoriasis, which occur when the immune system overreacts, is different to those with healthy skin. In those parts of the skin affected by psoriasis, there are higher levels of certain bacteria. It isn't known if these bacteria change because of the patches of psoriasis, or if they cause it.
UV light also affects the skin microbiome. Exposure to the sun can temporarily change the composition of the skin flora, and can possibly have a beneficial anti-inflammatory effect. A review in a dermatology journal suggested that sun-screen which filters out UV light, can reduce the diversity of the skin microbiome.
Topical antibiotics, while targeting those bacteria causing infection, will have a negative impact on the rest of the beneficial commensal/ normal skin bacteria. These products are better avoided, unless necessary, and antibacterial soaps and body washes can also affect the diversity of the microbes on the skin.