We propose a scheme for implementing Greenberger-Horne-Zeilinger states for three atoms trapped in distant cavities connected by optical fibers. Under the large detuning condition, the three distant atoms are coupled via four-photon processes induced by the vacuum bosonic modes and a classical field, leading to a phase shift proportional to the square of the atomic population in a certain state. During the process, the atoms do not undergo any real transition, the cavity modes and the fiber mode are only virtually excited, and the three-atom entanglement is produced in one step.