jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.03k stars 339 forks source link

User primary group is not reflected in TLJH terminal #865

Open deboomce opened 1 year ago

deboomce commented 1 year ago

Bug description

New TLJH users are added to the jupyterhub-users group, but also to a new group equal to their username (e.g. jupyter-x). When user jupyter-x creates a new file in the TLJH terminal, it is created with the jupyter-x primary group.

I tried to change the primary group as follows: sudo usermod -g jupyterhub-users jupyter-x In the TLJH terminal, running id still shows jupyter-x as primary group, which is not intended. Even when logging out and stopping all terminal processes, id still shows jupyter-x as primary group.

However, in a regular terminal window, id shows jupyterhub-users as primary group, as intended. Also, the /etc/passwd file shows the correct primary group ID.

Expected behaviour

sudo usermod -g jupyterhub-users jupyter-x should change the user's primary group in the TLJH terminal. id shows jupyterhub-users as primary group. New files and folders are created with jupyterhub-users as group.

Actual behaviour

id still shows jupyter-x as primary group. New files and folders are created with jupyter-x as group.

Specs

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

minrk commented 1 year ago

This is presumably something in how Systemdspawner creates the systemd unit to launch 'as the user'. Just to check: you have restarted the server for the modified user after making this change? It's the server process properties that really affect everything from terminals to kernels, since those are subprocesses that launch without changing any uid or gid.