Literally,
a lanyard is a short piece of rope or line for fastening something in ships;
as, the lanyards of the gun ports, of the buoy, and the like esp. pieces
passing through the dead-eyes, and used to extend shrouds, stays, etc.
Lanyard is actually the name given to a widely used piece of neckwear, which
is used to hang identity cards etc around the neck.