The attitude-tracking control of a rigid spacecraft using only two internal torques is addressed. First, a given reference trajectory is classified as feasible or unfeasible according to the preservation or violation of the momentum conservation law. The dynamics of the attitude-tracking error is then formulated on the attitude manifold SO(3) with the angular momentum of the actuators as inputs. Given the Lie group structure of SO(3), the transverse function approach is utilized to design an attitude-tracking law ensuring asymptotically ultimately bounded tracking error for any reference trajectory. For feasible reference trajectories satisfying certain persistence conditions, asymptotic tracking is achieved by constructing an asymptotically stable zero dynamics for the closed-loop system. To deliver control torques to the actuator command signals, steering laws are designed for two reaction wheels, two single-gimbal control moment gyros mounted in parallel, and one variable-speed control moment gyro, respectively. The resulting control law can be applied to a spacecraft with different kinds of momentum actuators but underactuated for tasks ranging from bounded tracking of a generic trajectory, three-axis earth pointing to line-of-sight pointing, etc. Numerical examples are presented to verify the effectiveness of the proposed method.