Inspired by the observation that the highly efficient, smooth, steady-state fish locomotion may result from the harmonic motion excited at one of its natural frequencies, we attempt to understand the mechanism of fish locomotion through the resonant vibration analysis of a continuous free-free beam with varying cross-sectional area, which is submerged in water. As a numerical analysis model, a linear finite element model of whiting (codfish) is constructed and its steady-state harmonic response is calculated, considering the nonlinear dynamic hydraulic resistance. It is found, from extensive numerical analysis with the fish model, that the wavy paddling motion, and thus the fish forward motion, can be effectively generated by the resonant vibration at its second natural frequency, when the neighboring modes also significantly contribute to the steady-state harmonic motion. The positive net thrust, which is mainly due to the interaction between the paddling motion and the resulting hydraulic resistance, monotonically increases, as the amplitude of fish motion increases. It is shown that the linear dynamic fish model can attain the forward moving speed of 0.27 times its body length per tail beat, when the maximum harmonic response amplitude of the fish tail at its second resonant frequency is limited below one tenth of its body length.