Help rigging a mechanical joint with one bone

I need help rigging this leg joint. I want all the seperate pieces to rotate with one bone.

I found a video that shows how to do it: https://www.youtube.com/watch?v=lscmG4o9sjg
But after following the steps, it still doesn’t work. I’ve tried messing around with the bone constraint settings and the rotation mode and nothing’s working.

I can’t upload the blend file because I’m a new user I guess


You do not need constraints, I do not know your final goal but if you select the bones like this in edit mode (the long “main” bone last = active bone yelow color)

Then hit Ctrl P and select “with offset”, that will make the main bone the parent of the others and they will follow its rotation.