Customizing username and hostname for jhub on kubernetes

Hi there,

In my organization we have a jhub deployed on kubernetes. I see that the spawned servers all have the hostname assigned to “jupyter-{username}” and all usernames are assigned to the usual “jovyan” user.
Question: Are such settings customizable? and if yes, is it advisable, or could I get into troubles?

The reason behind the need of differentiating the username is that we have mounted a shared volume, and since all the users are identical there is no possibility for them to control read/write permission. So I thought that differentiating them by assigning a different username (and probably userid) would overcome such limitation. What do you think?

The reason behind the hostname customization is purely cosmetic.

From some investigation, this is what I could get so far:

  • the username “jovyan” is defined in the base container (variable NB_USER). As far as I know it should be possible to change it using the “usermod” command (directly in the custom docker file). I didn’t try it yet…
  • for the “hostname”, I couldn’t find any specific place where the string “jupyter-username” is defined. Any clue?

many thanks in advance!
marco