In this paper, a distributed optimal steady-state regulation problem is formulated and investigated for heterogeneous linear multi-agent systems subject to external disturbances. We aim to steer this high-order multi-agent network to a prescribed steady-state determined as the optimal solution of a resource allocation problem in a distributed way. To solve this problem, we employ an embedded control design and convert the formulated problem to two simpler subproblems. Then, both state-feedback and output feedback controls are presented under mild assumptions to solve this problem with disturbance rejection. Moreover, we extend these results to the case with only real-time gradient information by high-gain control techniques. Finally, numerical simulations verify their effectiveness.