IIRC he was given a chunk of stock in a Linux IPO and while he lost most of its value in the dot-com crash, it still left him some spare change; add on consulting, royalties, the occasional job like being president, basic nerd frugal living, and you probably have the whole story.