Hey,
That works correctly. You need to do it on server side.
If you will do attaching on client side it will allow to explict cheat.
So you will need to send input from client to server and check if player can do it and than do it.
Same way most of your networking code should be done.