Context : Aims : ‘ Water in Star-forming regions with Herschel ’ ( WISH ) is a Herschel Key Program investigating the water chemistry in young stellar objects ( YSOs ) during protostellar evolution . Hydroxyl ( OH ) is one of the reactants in the chemical network most closely linked to the formation and destruction of H _ { 2 } O. High-temperature ( T \gtrsim 250 ~ { } \mathrm { K } ) chemistry connects OH and H _ { 2 } O through the OH + H _ { 2 } \Leftrightarrow H _ { 2 } O + H reactions . Formation of H _ { 2 } O from OH is efficient in the high-temperature regime found in shocks and the innermost part of protostellar envelopes . Moreover , in the presence of UV photons , OH can be produced from the photo-dissociation of H _ { 2 } O through H _ { 2 } O + \gamma _ { \mathrm { UV } } \Rightarrow OH + H . Methods : High-resolution spectroscopy of the 163.12 ~ { } \mu m triplet of OH towards HH 46 and NGC 1333 IRAS 2A was carried out with the Heterodyne Instrument for the Far Infrared ( HIFI ) on board the Herschel Space Observatory . The low- and intermediate-mass protostars HH 46 , TMR 1 , IRAS 15398-3359 , DK Cha , NGC 7129 FIRS 2 , and NGC 1333 IRAS 2A were observed with the Photodetector Array Camera and Spectrometer ( PACS ) on Herschel in four transitions of OH and two [ O i ] lines . Results : The OH transitions at 79 , 84 , 119 , and 163 ~ { } \mu m and [ O i ] emission at 63 and 145 ~ { } \mu m were detected with PACS towards the class I low-mass YSOs as well as the intermediate-mass and class I Herbig Ae sources . No OH emission was detected from the class 0 YSO NGC 1333 IRAS 2A , though the 119 ~ { } \mu m was detected in absorption . With HIFI , the 163.12 ~ { } \mu m was not detected from HH 46 and only tentatively detected from NGC 1333 IRAS 2A . The combination of the PACS and HIFI results for HH 46 constrains the line width ( FWHM \gtrsim 11 ~ { } km s ^ { -1 } ) and indicates that the OH emission likely originates from shocked gas . This scenario is supported by trends of the OH flux increasing with the [ O i ] flux and the bolometric luminosity , as found in our sample . Similar OH line ratios for most sources suggest that OH has comparable excitation temperatures despite the different physical properties of the sources . Conclusions :