We report the detection of absorption lines by the reactive ions OH+, H2O+ and H3O+ along the line of sight to the submillimeter continuum source G10.6$-$0.4 (W31C). We used the Herschel HIFI instrument in dual beam switch mode to observe the ground state rotational transitions of OH+ at 971 GHz, H2O+ at 1115 and 607 GHz, and H3O+ at 984 GHz. The resultant spectra show deep absorption over a broad velocity range that originates in the interstellar matter along the line of sight to G10.6$-$0.4 as well as in the molecular gas directly associated with that source. The OH+ spectrum reaches saturation over most velocities corresponding to the foreground gas, while the opacity of the H2O+ lines remains lower than 1 in the same velocity range, and the H3O+ line shows only weak absorption. For LSR velocities between 7 and 50 kms$^{-1}$ we estimate total column densities of $N$(OH+) $> 2.5 times 10^{14}$ cm$^{-2}$, $N$(H2O+) $sim 6 times 10^{13}$ cm$^{-2}$ and $N$(H3O+) $sim 4.0 times 10^{13}$ cm$^{-2}$. These detections confirm the role of O$^+$ and OH$^+$ in initiating the oxygen chemistry in diffuse molecular gas and strengthen our understanding of the gas phase production of water. The high ratio of the OH+ by the H2O+ column density implies that these species predominantly trace low-density gas with a small fraction of hydrogen in molecular form.