Shortly after, in the mid-1970s, he was thrown from his motorcycle one night, not far from his mother’s home. He had swerved to dodge a car. His right leg was barely attached below the knee. “I was in a cast for 66 weeks,” he said.

He began taking painkillers, and made regular trips to New York in the early 1980s to buy drugs for himself and to sell to others back home. He moved here about 1984. He ran out of money and landed on the Bowery in the Providence Hotel, one of what used to be many single-room-occupancy buildings for men. Mr. Foley said he does not drink or use drugs anymore, and he visits a methadone clinic on Cooper Square six days a week to curb cravings for opiates.

He has a long arrest record in New York City, mostly for possession of drugs or drug paraphernalia, and a few arrests for selling. It is unclear how many times Mr. Foley was convicted. The city’s jails held a man named John Foley with the same birth date 22 times since 1983. Mr. Foley said that number sounded low. Eighteen of the arrests involved drugs. No one with his name and date of birth is listed in state correctional records, but Mr. Foley said he served 18 months in a minimum-security prison beginning in 1984. He collects small disability checks from the government.

Along the way, in SoHo, he met Fish, the co-creator and first resident of the box.

“Fish was moving the box all over town, the poor guy,” Mr. Foley said. When Fish found his own place in Brooklyn, he gave Mr. Foley the box.

Mr. Foley wrote his name and address on the side and chained it to the pole on Broome Street. He said the police told him he could stay if he did not cause any trouble. He found a battery-powered nightlight, and slept on top of one sleeping bag and beneath another.

He read the papers and Sports Illustrated until the streets outside hushed. “The worst nights were Friday and Saturday,” he said. “You had the drunks going by. They would tease me, bang on the box. Wiseguys.”