In working on the backhoe I had to keep removing lines and valves. Unfortunately I had no idea how long the hydraulic shop would take. I was working with a good, fast, cheap, pick any two mechanic and I choose good and cheap. Therefore, I had no idea how log the hose lines would be disconnected.
Old tractors use non-detergent oil for hydraulics and that means water in the system causes havok. I needed a plug but out in the middle of the woods I had to make an improvised end cap.
To make my hydraulic line cap I tried to fit the fingers of thick latex gloves over the lines and tie them in place.
This worked very well for the non-pressurized lines, but on the cylinders under pressure, the back pressure blew my finger caps up like balloons. Some even popped over time.
If you are going to do this, I would recommend putting the hydraulic cylinders in a non-pressurized position, for a backhoe, that means resting on the ground. Luckily I also taped the hoses into groups and places the ends of the individual groups inside ziploc bags and taped the bags shut around the line ends, so even the improvised caps that failed did not get water in the line.