Margarita Alvarado, 39, said she lived with Mr. Pastore, who was then her boyfriend, outside on the ledge for three years, spooning together for warmth. “You get so used to it, you actually get to like it,” said Ms. Alvarado, who now lives in a basement apartment nearby.

Mr. Grillo and Mr. Pastore recounted sharing their tent with large groups, sleeping five at a time. On occasion, Mr. Pastore said, he has allowed prostitutes and their clients to use the tent, charging the clients $5.

The men spoke of sleeping soundly through snowstorms, heavy rainfalls and honking horns. Raccoons and feral cats have visited, but not many rats. Some drivers have tossed fast food and packs of cigarettes at their tent. Others have thrown trash and empty bottles.

Every so often, they have awakened to maintenance crews mowing the grass and removing weeds. But no one has ever touched the tent, which has been captured on at least one Instagram video that has been circulated on the web.

In the daytime, the tent serves as “the neighborhood community center,” a gathering spot for drinking, smoking and conversation, Mr. Pastore said. “I used to play baseball on this hill as a kid.”

He said he attended Brooklyn Technical High School and then worked at printing shops on Long Island and in Manhattan. At one point, he bought two apartment buildings in South Park Slope, but then lost them to foreclosure after a descent into drug use. Homelessness followed, and he began his current strategy for making money: collecting and redeeming scrap metal and doing odd jobs around the neighborhood.

Walking along Fourth Avenue recently, he pointed to a new crop of sleek apartment buildings.

“That one has luxury rentals starting at $3,800 a month for a two-bedroom,” he said. “Is that crazy? Who could afford that? It’s getting to be like Park Avenue here.”