Euclid comes up a lot in my maths class so it made me wonder. Modern academics make money from book sales and teaching at universities, but Ancient Greece didn't have book publishers or universities.
Some were independently wealthy. Some had wealthy patrons. Some lived in poverty. Some wrote biographies or histories for their patrons (Just because there weren't publishers doesn't mean there was no money in writing). Some tutored. Some opened schools. Some argued for a living (In Athens and apparently in other states it was popular to hire a champion thinker to argue your political point). Pythagoras started a cult. Some we have no idea what they did. Many we only know of because they are mentioned in other peoples writings.
Diogenes Laertius wrote a book of anecdotes about philosophers that gives us much of the information we have today. Though his works should be taken with a grain of salt as he seems to have been more interested in telling stories than preserving history or philosophy.
Many public intellectuals plied their trade via teaching or private tutoring. They didn't make anything on book sales, but neither do university professors now- the publisher profits from that work). For example, the Sophists in ancient Greece would travel from city state to city state and would perform a speech publicly to demonstrate their prowess as orators before opening a temporary school or accepting pupils. Both of these services would cost money.
Interestingly, this practice was seen as controversial by many other public intellectuals. Plato, for instance, thought education should be free and critiqued the Sophists for their fly-by-night approach to education (though several scholars now argue that Plato was unfair in his treatment and could have exaggerated his account).
This has remained a common form of income for scholars in the Western world, picked up by Cicero and the Romans through the middle ages and clearly present today.
Another source of income was tied to the growing influence of democracy. Now that courts were open to settle public dispute, the Greeks needed people who were familiar with court practice. Private citizens could enlist the help of a learned man as a kind of legal consultant who could assess their case and write speeches for them (a goat farmer would not have the experience to go about crafting a strong legal position on his own).
Oration was a very important part of Greek society, and it was expected at events like weddings, funerals, or holidays. Let's imagine you were celebrating a certain special event and invited people to your house. If you were a person of some status, you could hire a logographer (speech writer) to write a speech to commemorate the occasion, rehearse it, and perform it as your own, thus dazzling and entertaining your guests. Isocrates, another philosopher from the period, appears to have gotten his start as a logographer before opening a school.
Source: Greek Rhetoric Before Aristotle by Richard Enos, and a smattering of journal articles from Philosophy and Rhetoric. I wrote a paper in a graduate seminar on Sophistic invention and pedagogy.