son of a gun
The U.S. Navy publication Nomenclature of Ships (John Snelling, 1981) describes the origin of this phrase as follows:
In an attempt to keep down the large number of deserters in the British Navy, the sailors were kept on board their ships while in English ports. But "wives" were allowed on board; one per man, with no questions asked. Cramped conditions on the ships caused the "ladies" to sling their hammocks between the guns in the 'tween decks. The phrase "son of a gun" originated here. In fact, the expression questioned the legitimacy of anyone. The old definition of a man-o'-war's man was "Begotten in the galley and born under a gun. Every hair a rope yarn, every tooth a marlin's spike, each finger a fishhook and in his blood, right good Stockholm tar."