With a high enough Speech skill, the Lone Wanderer can convince him that there are enemy forces on the ship's deck; he will thank them for the "assistance" and hurry off. Roughly thirty seconds later, he will resume his post and will not try to kill or arrest the Lone Wanderer.
If the Lone Wanderer can successfully talk him into leaving, pick the door lock, and take out the automated turret before he comes back, they will be able to freely come and go even after he returns to his post. Aside from some of the containers marked with red text, the Lone Wanderer can take anything from the armory, even while he's watching, without effect.
It is also possible to attempt to gain access to the Rivet City armory by telling him one is there to inspect it. Unfortunately, the robot will recognize the ruse and warn he will shoot.
pcxbox360 A security guard may run and open the room where the turret is located, then become hostile to the player. This causes Private Jones and everyone in the vicinity to turn hostile as though the Lone Wanderer opened the door. [verified]