They can't, realistically. Nor would you want them to, since bacteria are an integral part of all living organisms. Your body, right now, contains more bacterial cells than human cells.
The simplest way to prevent bacteria from living on a small patch of anything, is to coat that thing in honey. Honey is sterile, bactericidal, and fungicidal. This is because, counterintuitively, honey is "dry" for the purposes of biological metabolism, preventing microorganisms from growing on it.