They do try to escape. I was lucky enough to be able to keep them in open tanks because the tanks were large, with ~ 1m sides, and I kept it filled to about .5 m. I lined the top of the tanks with astroturf, because I was told that it would prevent their suckers from grasping the sides. I found it to be unnecessary, though, because they weren't strong enough to pull themselves all the way up the sides of the tank above the water line. So having tall sides above the water line might help.
It may have also helped that those large tanks were not transparent, so the octopus couldn't see an escape route. They rarely made much of an attempt in those large tanks and that may be part of the reason why.
When I kept them in smaller plexiglass tanks - which I did only temporarily - they were very difficult to keep in. I put plastic grate on the top but weighed it down with a lot of weight - buckets of water and such. I still had a couple escape that I luckily found before they dried out and died.
Overall I found them fairly easy to keep. I fed them dead shrimp that I bought frozen at the grocery store. They didn't know what it was at first, so I would put one on the end of a long wire and make it dance around for them so they'd grab it. Many rejected them the first couple of times, but when they realized there weren't any crabs hidden in the coral rubble of the tank, they started to eat them. That usually took 3-5 days. Then I tried to hide the food under rocks so they'd have to come out and find them. That worked for some of them, but others caught on to where the shrimp were coming from and would come over to me as soon as they saw me.
A couple never got used to being in captivity and were especially startled at having groups of people leaning over the tank to look at them. If they're not eating or seem frightened of your presence after a week or two, it might be better to just let it go (or completely restrict access to the tank if you have to have him - as if they're for research). Others couldn't care less about a lot of people, and come out (presumably for food) at the first sign of people.
Are you keeping them as pets? Are they in lab tanks or home tanks? Are you close to the ocean?
Boy, I sure miss my octopuses ...
Gayla