It was Mohamed Khaleuf's third attempt to cross the Greek-Macedonian border. Hiding in a freight train, he told Reuters photographer Alexandros Avramidis that he was not planning on giving up.

"I promised myself I would try five times. If I'm not successful, I will try to cross from somewhere else," Khaleuf told Avramidis, who has been photographing Khaleuf and his friends, as they try to cross the border into Macedonia and eventually, central Europe.

Habib, 22, from Algeria sits in an abandoned railway wagon used as a shelterAlexandros Avramidis/Reuters

Still in his early twenties, Khaleuf is among dozens of people, mostly young Moroccans, Tunisians and Algerians, who arrived in Greece in the last year, and have since found shelter in old rusting carriages around a station in the outskirts of Greece's northern city of Thessaloniki. From there, they monitor freight trains heading to central Europe. Whenever trains stop in the station, they try to sneak into the compartments or jump in between wagons.

If they're lucky, they make it across unnoticed. Some said they plan to get off before the border and continue on foot. Often, they are arrested by Macedonian guards and sent back to Greece. No one can say how many have made it. A Greek government spokesman was not immediately available for comment.

Habib (L), 22, from Algeria and a friend run to jump on a freight train in an effort to cross the Greek-Macedonian border without documentsAlexandros Avramidis/ReutersA person jumps on a freight train in an attempt to cross the Greek-Macedonian border without documentsAlexandros Avramidis/ReutersHabib, 22, (R) from Algeria looks around as he and a friend jump on a freight train in an effort to cross the Greek-Macedonian border without documentsAlexandros Avramidis/Reuters

In the abandoned trains where Khaleuf and others live, conditions are grim. There is no electricity or running water, and for food, they must queue up at a nearby camp, a former toilet paper factory. Yet despite the dire conditions, many choose the carriages over the camps as they can keep an eye on passing trains. People come and go, leaving piles of rubbish behind. Some carriages burned down in accidents when people tried to warm up in freezing winter temperatures.

"Here we live like animals," said Habib, a 22-year-old Algerian who spoke to Avramidis. Habib crossed from Turkey to the island of Rhodes and then hid under a truck on a ferry to Athens. Habib had attempted to leave Thessaloniki with a friend days earlier. They had leapt onto a train with their rucksacks, but without documents, the pair were arrested in Macedonia and were sent back to Greece.

Rubbish is seen between abandoned railway wagons that are used as sheltersAlexandros Avramidis/ReutersA person sleeps inside an abandoned railway wagon used as a shelterAlexandros Avramidis/ReutersAn Algerian man holds up his injured hand inside an abandoned railway wagon used as a shelterAlexandros Avramidis/Reuters

More than a million people arrived in Europe in 2015, landing in Greece from Turkey and then streaming through the Balkans, heading north to Germany or Austria. The route was closed in March 2016, following an agreement between the EU and Turkey. This left around 60,000 people stranded in camps – both makeshift and formal across Greece.

Habib, 22, from Algeria is seen with his friends on an abandoned railway wagon used as a shelterAlexandros Avramidis/ReutersA person walks between abandoned railway wagons that are used as sheltersAlexandros Avramidis/ReutersAn Algerian man sits in an abandoned railway wagon used as a shelterAlexandros Avramidis/ReutersA man shows a picture on his mobileAlexandros Avramidis/ReutersA note on a wagon announces the route of a freight train from Thessaloniki to Gevgelija, Presevo and Kelebia, in the northern city of Thessaloniki, GreeceAlexandros Avramidis/ReutersIman, 39, from Morocco, stands inside an abandoned railway wagon used as a shelterAlexandros Avramidis/ReutersAn Algerian man smokes inside an abandoned railway wagon used as a shelterAlexandros Avramidis/ReutersPeople walk among railway wagons in the northern city of Thessaloniki, GreeceAlexandros Avramidis/Reuters