The good news is that the rocket attacks missed, the bad news is that apparently, none of the vaunted active defense systems designed to protect American ships from this kind of attack, such as the Close In Weapons System, are activated when the ships are in port.
There were about 3,650 American sailors and Marines on the two ships attacked (in addition to large quantities of military equipment). It is only by sheer good luck that a large number of them didn't die and that those assets were not taken out of action.
Would a couple of rockets of the type used sink the ships? Probably not. But, they could certainly have done a lot of damage and killed plenty of people. And, next time, the rockets or cruise missiles deployed when U.S. ships are at port might be more powerful.
There are only two kinds of vessels at sea, submarines and targets. We have been lulled into thinking otherwise only because no one has been doing much target practice lately. (No, that isn't strictly true, but it certainly has a shread of truth to it).