  We propose a scheme for generation of maximally entangled states involving
internal electronic degrees of freedom of two distant trapped ions, each of
them located in a cavity. This is achieved by using a single flying atom to
distribute entanglement. For certain specific interaction times, the proposed
scheme leads to the non-probabilistic generation of a perfect Bell-type state.
At the end of the protocol, the flying atom completely disentangles from the
rest of the system, leaving both ions in a Bell-type state. Moreover, the
scheme is insensitive to the cavity field state and cavity losses. We also
address the situation in which dephasing and dissipation must be taken into
account for the flying atom on its way from one cavity to the other, and
discuss the applicability of the resulting noisy channel for performing quantum
teleportation.
