Hippies can be traced back to a late 19th century German naturmenschen countercultural movement that embraced nudity, paganism, and natural foods. Gordon Kennedy wrote a good photo-filled book about the movement called Children of the Sun. Here's an article he co-wrote with a lot of the same info and photos.
The movement spread to California in the early 1900s, where a few young men grew long hair and beards and lived in primitive cabins in the Palm Springs area. The most famous of them was William Pester, the "Hermit of Palm Springs." Both photos of Pester shown here were taken in 1917.
Over at Harp Guitars, Gregg Miner has written a lengthy and fascinating article about Pester and his influence on the "California Nature Boys" who lived in Los Angeles in the 1940s.
Kennedy summed up Pester thusly: "The many photos of Pester clearly reveal the strong link between the 19th century German reformers and the flower children of the 1960s…long hair and beards, bare feet or sandals, guitars, love of nature, draft dodger, living simple and an aversion to rigid political structure. Undoubtedly Bill Pester introduced a new human type to California and was a mentor for many of the American Nature Boys."
The "California Nature Boys," as they were soon dubbed, were young Americans who hung out at Eutropheon, a health food store on Laurel Canyon Blvd in Los Angeles, adopting owner John Richter's "transcendentalist philosophy, wearing long hair and beards and eating only raw fruits and vegetables." Beat Generation author Jack Kerouac wrote in On the Road that he saw "an occasional Nature Boy saint in beard and sandals" while passing through L.A. in 1947. Soon, one of these "Nature Boys" – eden ahbez – would become quite famous after writing a song based on this name.