The equilibrium properties of a Janus fluid confined to a one-dimensional channel are exactly derived. The fluid is made of particles with two faces (active and passive), so that the pair interaction is that of hard spheres, except if the two active faces are in front of each other, in which case the interaction has a square-well attractive tail. Our exact solution refers to quenched systems (i.e., each particle has a fixed face orientation), but we argue by means of statistical-mechanical tools that the results also apply to annealed systems (i.e., each particle can flip its orientation) in the thermodynamic limit. Comparison between theoretical results and Monte Carlo simulations for quenched and annealed systems, respectively, shows an excellent agreement.