Neil Armstrong was a civilian when he joined NASA's astronaut corps. He became the first civilian in space.
Buzz Aldrin was on active duty in the US Air Force during his astronaut training for NASA. He retired as a colonel on March 1, 1972.
Michael Collins was also on active duty in the US Air Force when he was selected for astronaut training by NASA. He eventually retired as a major general.
Why did NASA select a civilian to lead the first mission to put humans on the moon?
Almost all other Apollo astronauts were military officers in the Navy or Air Force. The only other civilian was the geologist, Harrison Schmitt.