A laboratory experiment shows that fluid can be pumped from one end to another in a narrow channel whose sawtooth walls vibrate transversely opposite to each other. The phenomenon is referred to as ratcheting fluid. Inspired by this, we put forward here a theory describing the rectified steady flow, and the net directional pumping. In a conformally transformed plane, the induced steady streaming in the Stokes boundary layer of the oscillatory flow is analysed, elucidating the driving mechanism that is due to the nonlinearity and viscosity. The solution of the stream function is given, showing the complex spatial structure of the induced steady flow and its spatial average that is related to the directional pumping. Whereas the wall sawtooth shape is the primary source of asymmetry, the difference in entrance and exit flow conditions due to the geometries at channel ends is found to be a secondary source to break the left–right symmetry of the system. This latter can affect the net directional transport of fluid, in particular in short channels with a small number of sawteeth. Various influences on the net pumping rate are analysed.