Problems of identification and control of biological systems have recently attracted an increasing amount of attention. Most work in this field has classically focused either on gene or protein networks. In this manuscript, we focus on the control of a behavioral trait emerging from a signaling network: aerotaxis, the directed motion of bacteria towards (or away from) oxygen. To do so, we consider a bacterium, Bacillus subtilis, which is strongly attracted by oxygen, and we quantitatively probe the dynamics of accumulation of populations of this microorganism when exposed to tightly controlled gradients of oxygen generated in a microfluidic device. Combining in-vivo experiments with system identification methods, we determine a simple model of aerotaxis in B. subtilis, and we subsequently employ this model in order to compute the sequence of oxygen gradients needed to achieve regulation of the center of mass of the bacterial population. We then successfully validate both the model and the control scheme, by showing that in-vivo positioning control can be achieved via the application of the precomputed inputs in an open-loop configuration.