This comes from Confucius, in his Analects, 9.26.
The Master said: “You can snatch away the general of a large army, but you cannot snatch away the will of even the lowliest of men.”
This connection is made in Bill McKibben's edition of Walden, page 307.
From the context, it appears that the quote is saying that everything progresses - what was good for the ancient people is not necessarily good for us now. For instance, a house is for people today, and we're fine with that. A cave was for the cavemen, and he was fine with that. What your grandparents used is not necessarily what you want to use.