In a memoir, astronaut Michael Collins relates a story of a physician back in the Apollo era who recommended regular masturbation on long missions, lest astronauts develop prostate infections. The flight surgeon for Collins’s moon mission “decided to ignore that advice,” and ignoring seems to have been the basic approach to the human sex drive ever since. It’s the same way at the Russian space agency. Cosmonaut Alexandr Laveikin told me he too had heard that lengthy abstinence could cause prostate infections, but that the space agency pretends the issue doesn’t exist. “It’s up to yourself how you will deal with it. But everybody is doing it, everybody understands. It’s nothing. My friends ask me, ‘how are you making sex in space?’ I say, ‘By hand!’” As for the logistics: “There are possibilities. And sometimes it happens automatically while you sleep. It’s natural.” John Charles told me he’d heard about the link between prostate health and “self-stim” --at NASA, there’s an abbreviation for everything-- but never heard any formal discussion, pro or con, of orbital masturbation.
From the book “Packing for Mars” by Mary Roach: