It is possible. You need an agreement and a lawyer to make it happen.
Ask A Question | Learn more about Greece
How can foreigners use lease agreements to qualify for golden visas in Greece?
I'm interested in signing a 10-year lease agreement with a hotel or tourist establishment in Greece. How can I do that and also get a golden visa?