How to infer linux username from Hub username when using Firstuseauthenticator?

Linux usernames do differ from the JupyterHub usernames. Apart from the apparent prefixing with jupyter-, very long usernames get truncated and suffixed with some kind of hash.

I need to set up linux groups to enable users to share a directory. However, I only have the Hub usernames and cannot identify the corresponding linux user name.

Just in case it matters, the JupyterHub is deployed on a Ubuntu 18.04.5 using tljh.

I found the relevant lines myself in the tljh repo.

Here is a gist of a CLI to convert hub usernames to linux system usernames.