Swimming bacteria display a remarkable tendency to move along flat surfaces for prolonged times. This behavior may have a biological importance but can also be exploited by using microfabricated structures to manipulate bacteria. The main physical mechanism behind the surface entrapment of swimming bacteria is, however, still an open question. By studying the swimming motion of Escherichia coli cells near microfabricated pillars of variable size, we show that cell entrapment is also present for convex walls of sufficiently low curvature. Entrapment is, however, markedly reduced below a characteristic radius. Using a simple hydrodynamic model, we predict that trapped cells swim at a finite angle with the wall and a precise relation exists between the swimming angle at a flat wall and the critical radius of curvature for entrapment. Both predictions are quantitatively verified by experimental data. Our results demonstrate that the main mechanism for wall entrapment is hydrodynamic in nature and show the possibility of inhibiting cell adhesion, and thus biofilm formation, using convex features of appropriate curvature. DOI: 10.1103/PhysRevLett.114.258104 PACS numbers: 47.63.Gd, 87.17.Jj, 87.18.Ed Self-propelled bacteria living in aqueous media have constant, vivid interactions with their local environment, which may dramatically alter their swimming behavior [1][2][3][4][5][6][7][8]. Often, bacterial habitats are physically confined by solid boundaries. Physical interactions with these solid surfaces give rise to a rich variety of dynamical phenomena like steering or rectification of swimming direction [9] and the propulsion of microfabricated structures [10]. Understanding the physical mechanisms behind cell-surface interactions is of crucial importance to design structures that could fully exploit those effects for microfluidic applications. On the other hand, a quantitative understanding of wall entrapment and subsequent adhesion would allow us to design surfaces that hinder unwanted biological processes like biofilm formation. Surface colonization by biofilm-forming bacteria is initiated by cell contact and adhesion to the surface [11][12][13]. The subsequent biofilm growth can cause highly resistant bacterial infections on medical implants and catheters or impaired industrial equipment [14][15][16][17][18][19].Using a tracking microscope, Frymier et al. observed that bacteria display a marked tendency to swim adjacent to wall surfaces [20]. At the beginning, this behavior was attributed to an attractive interaction potential between the cell body and the solid surface. It was later proposed, however, that, while DLVO forces could be responsible for irreversible adhesion, wall entrapment during swimming may have a purely hydrodynamic origin [21,22]. Hydrodynamic effects can indeed give rise to wall entrapment via two distinct mechanisms. The first one is via farfield, dipolar flows that, once reflected by a flat wall, give rise to reorientation parallel to the wall surface as well as an attraction by the wa...