PATRAS, Greece — On a recent morning, the young men began to drift back to the abandoned furniture factory, returning from the beach, the roofs of nearby construction sites and other hiding places where they had been sleeping.

Amid rotting timbers and piles of garbage, one man from Afghanistan did his laundry; another shaved using cold water from a fraying hose. The mood was bleak.

The police had raided at dawn, rounding up more than 30 of their friends, many of them just teenagers.

 

The men ended up here because Greece, through its border with Turkey, is easier for unauthorized immigrants to reach than most of the rest of Western Europe. But after a long and often dangerous trip, they found themselves not in the land of opportunity they had envisioned, but in a country struggling to take care of its own people and increasingly hostile toward the waves of immigrants arriving from Afghanistan, Iran, Sudan and other ravaged or repressed places.

For the migrants, the result has been a mix of disillusionment and despair and, for some, a determination to take on yet another risky and surreptitious journey. Each day the men squatting in the row of crumbling factories in this gritty port city hope to steal away on the ferries across the street, heading for various ports in Italy and then, perhaps, elsewhere in Europe.

But many have been stuck here for months, making a life as best they can behind broken fences and waist-high weeds, out of sight of the Greeks who shout insults and throw garbage at them when they venture into the streets.

There is a barber chair in one of the factories and an area where the young men do chin-ups on the pipes. They charge their cellphones from a fuse box at a nearby construction site and pool their resources to cook, usually one meal a day, usually rice. But there is no getting away from the filthy toilets, the boredom and the fear that they will not be able to move on.

Inside the factories, the immigrants divide by age, country of origin and tribal affiliations. The teenagers — with American television shows on their smartphones — still have hope about what life may yet offer, and a charity that provides breakfast, showers and access to the Internet.

But the older men receive no such help, and many have grown bitter. “Do you think this is fun?” one of the men said before walking away. “Do you think we are used to living in trash where we come from?”

With its economy in tatters, Greece has plenty of its own citizens barely surviving and few resources to help the many immigrants who have continued to arrive in recent years. Watchdog groups have repeatedly cited Greece for wretched conditions in many of its detention centers and, more recently, for pushing immigrants back into Turkey.

Even those who are free to move around Greece say that immigrants face overwhelming hostility. According to the Greek investigative magazine Hot Doc, a top police official was recorded in December saying that the lives of unauthorized migrants should “be made unbearable.”

Some of the young men trying to get on the ferries tell stories of the Taliban invading their villages, of wandering from country to country after their parents died. Some show the scars of battle — a calf missing a chunk of flesh, a scar across a shoulder.

Some have managed to sneak onto the ferries several times, only to be returned by the Italian authorities.

Advocates say many of the young men have unrealistic expectations of what they will find elsewhere in the European Union. “But what can you say?” said Christina Tampakopoulou, a member of a volunteer group, the Movement for the Defense of Refugee and Migrant Rights, that sometimes visits the men and assists when it can. “Here, it is worse.”

By early afternoon, it was time to change into dark clothes and slip between the bent bars of the fence surrounding the ferry terminal. The young men could be seen darting among the lined-up 16-wheelers, searching for an unlocked container or, barring that, a way to hitch a ride under the trucks.

But getting out of Greece this way has become more and more difficult. Inspectors at the ferry terminal had little trouble spotting Mohammed Morsal, 27 years old and easily six feet tall, curled up in the spare-tire rack under a truck. Soon, he was in handcuffs.

Asked whether his family knew where he was, Mr. Morsal, from Sudan, looked down at the floor and broke into sobs. “They are all dead,” he said, before being escorted away by officials.

Tryfon Korontzis, the Coast Guard captain who oversees the port, says he is engaged in a sad cat-and-mouse game, aware each day that elsewhere in the world, Greeks, too, are trying to make a living in foreign countries. Most days his inspectors find two or three men hidden in the trucks. Some have been near death after spending hours in refrigerated containers or buried and gasping for air in piles of cotton seed.

Released after six hours in detention, Mr. Morsal made his way back to a tire factory, where stained mattresses were scattered about.

He applied for asylum five years ago, he said, but his case is among the 25,000 in a backlog here. He has never heard anything from the authorities. Even if he did, the news would probably not be good. Greece granted asylum to fewer than 5 percent of applicants last year, according to European Union statistics.

“We eat from garbage like animals,” Mr. Morsal said. “These people drive by on motorcycles and they throw bottles at us.”

Mr. Morsal has tried to find work here, as have most of the men who live in the factories. Not long ago he worked in the strawberry fields south of here for a month, but the farmer would not pay him.

Advocates for immigrants say that men like Mr. Morsal are in a kind of bureaucratic black hole. European Union rules say he cannot apply for asylum anywhere else, now that he has filed his papers in Greece. He must stay here and wait.

“He has no choices,” said Daniel Esdras, who heads the office of the International Organization for Migration in Athens, which helps immigrants go home. Last year, 10,000 immigrants chose that route, including many Georgian women who had labored in Greece for years as housekeepers and lost their jobs because the Greek families who employed them could no longer afford their wages. Three years ago, only 400 signed up with the group.

But going home is only an option for the immigrants who do not fear for their lives.

Mohammed Riza said he could not return to Iran. He was studying, teaching English and living with his parents until the authorities got wind of his interest in Christianity and the police came looking for him. “They hang you for that in my country,” said Mr. Riza, explaining why he had headed for Europe on a bus. He said that his father, who is a mechanic, and his mother, who runs a clothing shop, had encouraged him to flee.

He showed a grainy video of his family on his phone, a slight smile on his face. Mr. Riza also has four seasons of “How I Met Your Mother” on his phone.

Like most everyone else in the factory here, he said, he has moments of depression.

But his friends provide moments of humor. After being thwarted at the ferry terminal recently, they carried scavenged pieces of Styrofoam insulation to the beach to use as surfboards.

Soon, Mr. Riza and the others were in their underwear, splashing and teasing one another. One of the boys started paddling furiously. “Look,” he shouted. “I am going to Italy.”

WATCH THE PICTURES