UnityEngine.InputSystem allows you to share a single device with multiple players. (see https://docs.unity3d.com/Packages/com.unity.inputsystem@1.6/manual/PlayerInput.html ). Enabling setups such as 2 players using a single keyboard.
However, it's not easy to setup. Especially if you want to support using the InputSystems control rebinding and/or the ability to create the player only when they press a button on their shared section of the device.
This package contains 6 game-kit style setups showing the bare minimum to achieve functionality. Each setup builds on the last, helping you isolate what parts do what. Setup so that you can easily isolate the code that interests you. Then copy/paste only what's needed.
I created this package after struggling to solve this issue myself and not finding much help. If you'd like to go at it alone, for free, my initial forum post is a potential starting point.