Based on the input-output relation in low-Q cavities, we propose a feasible scheme to prepare remotely a single-atom state via photonic Faraday rotation, and then the scheme is generalized to the case of remote preparation of a two-atom entangled state. Our results show that when the coefficients of the initial atomic state to be prepared are real, both remote preparation of the single-atom state and that of the two-atom entangled state can be achieved deterministically by selecting appropriate parameters of the systems for the interactions among the atom, polarized single-photon pulse, and cavity field. Compared with the existing schemes for remote preparation of atomic states, in our scheme photons are used as flying qubits to transmit quantum information, which is suitable indeed to achieve a long-distance atomic state preparation in principle. Due to the fact that the information of atomic state is encoded in two degenerate ground-state levels of a -type three-level atom confined in a unilateral dissipative cavity, and that the atoms are only virtually excited, our schemes are insensitive to both cavity decay and atomic spontaneous emission. Besides, the two schemes we proposed do not need two- or multi-particle orthogonal measurements, only product-state measurements are involved, as well as they work in low-Q regime and do not require a strong coupling condition between the atoms and the optical cavities, which greatly reduce the experimental difficulty.