My brother went to rehab. It was very easy for him to recover there because he had no access to anything.
Albeit, when he got out, he never learned how to actually stay away from drugs or avoid temptation. He was a junkie even if he didn't have drugs, for food, fornication, media, and eventually drugs again.
I think you should write your password down, put it somewhere that takes some effort to reach, and try to keep yourself off without taking the easy way
(Also bad analogy, since junkies should go to rehab even if it's a "cop-out," they just need to care enough to learn the skills they're taught)