Jesus fecking christ, man...you cant run hubs without the driveshafts in place. The end of the driveshaft and the hub nut hold everything in place and keep the bearing tight.
If you want to remove the rear shafts, split the outer CV joints apart so that the end of the shaft still goes through the hub, refit the hub nut and it will be fine.
You will need a new bearing on that side and you will want to be checking the bearing on the other side, as if you have driven it like that for a while, it may well have worn very rapidly as it wasnt tightened up properly.