The viscosity of a rarefied gas in nanochannels under normal conditions is studied. The viscosity coefficient is calculated from the Green–Kubo formula using the stochastic molecular method. The interaction of gas molecules with the wall is described by the specular, diffuse, or specular-diffuse laws. Gas temperature and channel height are varied. It is shown that the viscosity in the nanochannel is essentially anisotropic. Along the channel, it almost always coincides with its corresponding bulk viscosity. By varying the accommodation coefficient, the total viscosity of the gas can be either reduced or increased several-fold.