How to make a file available to all users in JupyterHub?

I have deployed a JupyterHub env in Azure Kubernetes
I want to make a read-only file available to all users in JupyterHub. I following this link which makes it possible to do so:

I am logged in as admin user in JupyterHub.

But when I try to run the following command:

$ mkdir -p /srv/data/my_shared_data_folder

I’m getting this permission error:

mkdir: cannot create directory ‘/srv/data’: Permission denied

What more permissions do I need to give in order to create a directory and put a read-only file in it that is available to all users?

Are you executing the mkdir command as root? If not, you need to add sudo to that command. Probably that is why you are getting Permission Denied.

Yes, I tried earlier with sudo mkdir and then got the below error:

/bin/sh: 1: sudo: not found

TLJH is meant to install on a bare metal or VM server. As you have deployed JupyterHub on k8s, you must create a persistent volume and bind them to single user server containers in read only mode. Check docs on how to do this in k8s

2 Likes