Molecular simulations reveal the mechanism and the determinants for ampicillin translocation through OmpF.