How to change jovyan to {username} in jupyter single user image

By default, jovyan is the user in jupyterhub single user image when you do “whoami” in the base notebook container. How to change it to {username}?

Quick question: why would you want to do so?

First of all, nobody stops you from administering the docker container with Linux tools as you wish (except systemd which is not available). So you can create users etc. and setup everything manually for another user.

If you want to do less manual administration, a better way might be to define your own docker image similar to what you are currently using. Most likely you use one of the images defined at GitHub - jupyter/docker-stacks: Ready-to-run Docker images containing Jupyter applications.

Even though changing the username is technically possible, I would just stick with the user jovyan if there are no specific reasons why in your work context this is impossible.

1 Like

@hokiegeek2 this is not part of the initial question of heisenberg.