Local control of entanglement in a spin chain