Military officials said that the strikes targeted missile sites near a major Iranian port that threatened U.S. ships.