Establishing shared secret keys on quantum line networks: protocol and security