If you have a high enough Speech skill, you can convince him that there are enemy forces on the ship's deck; he will thank you for the "assist" and hurry off. Roughly thirty seconds later, he will resume his post and will not try to kill or arrest you.
If you can successfully talk him into leaving, pick the door lock, and take out the turret before he comes back, you 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, you can take anything you want 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 you are there to inspect it. Unfortunately, the robot will recognize your ruse and warn you he will shoot you.
pcxbox360 A security guard can run and open the room where the turret is and then turn on you. This causes Private Jones and everyone in the vicinity to turn hostile as though you opened the door. [verified]
xbox360 A way to enter the vault without turning private jones hostile is walk up to the door with a companion, he will notice the turret and turn hostile, if you are far away enough, your companion will open the door and kill the turret, allowing you thorough access in and out of the armory (only confirmed with Jericho). [verified]