Old English sceaft "long, slender rod, staff, pole; spear-shaft; spear," from Proto-Germanic *skaftaz (cf. Old Norse skapt, Old Saxon skaft, Old High German scaft, German schaft, Dutch schacht, not found in Gothic), which some connect with a Germanic passive past participle of PIE root *(s)kep- "to cut, to scrape" (cf. Old English scafan "to shave, scrape, polish") on notion of "tree branch stripped of its bark." But cf. Latin scapus "shaft, stem, shank," Greek skeptron "a staff" (see scepter) which appear to be cognates.
Meaning "beam or ray" (of light, etc.) is attested from c.1300. Sense of "an arrow" is from c.1400; that of "a handle" from 1520s. Mechanical sense is from 1680s. Vulgar slang meaning "penis" first recorded 1719 on notion of "columnar part" (late 14c.); hence probably shaft (v.) and the related noun sense "act of unfair treatment" (1959), though some early sources insist this is from the notion of a "wound."