Even in port when they are about to embark on a mission ?
What about taking over just the main gun batteries of a battleship and targeting other ships in port ?
You have man the magazines, and retain control of the power plant to keep the turrets operating. I expect the electrical connections to the turret would have to be guarded as well. The ships crew would know where handy circuit breakers might be. The commandos would have a less perfect knowledge of that & other details.
Operating the ships boilers, turbines, electrical generators is a highly technical affair. The nature of naval architecture means each system has its own idiosycracies, even in the same class. Without the experience of ten and twenty year petty officers and the in-depth knowledge of the engineering officer you run a real risk of setting the engine room on fire or bursting high pressure steam pipes. Tripping a dozen or more circuit breakers at random locations through the ship is another show stopper.
Once the crew is subdued the two practical options are to: 1. Place explosives in the magazines or on live boilers & run away fast. 2. Call for the tow & depart the area at a stately 3 knots. Towing hulks is a slow, ponderous, and tricky affair. Currents, wind, tides, rocks and shoals are your enemies here