I'm running ipython notebook server on the cloud and i want to expose this as a service so that users can play around with the notebook, i noticed that using notebook i can access the filesystem and inspect files on the filesystem, i want to limit this access.I want only special folders to be accessible from ipython notebook.
1 Answer
You can launch your iPython notebook in the folder that you want the server to have access to, and the user won't be able to go to the parent directory, but you should realize that when the user launches a kernel, they will be able to chdir to any folder in the file system.
So if you want to limit access to users of the iPython notebook, you should use unix file permissions to jail the user to their starting folder.
The way I would do this is to:
- Create an
ipythonuser that doesn't belong to any existing user groups - Create a folder for the ipython user (
cloudfor instance) - Launch the iPython notebook as
ipythonin thecloudfolder
2 Comments
Jarno
This might be a very basis question but how would I give the new user access to the, by now,
jupyter notebook command? After adding the user and logging into the shell as the new user I do no longer have access to the command. Do I need to reinstall Jupyter for the new user?shad
@Jarno Instead of having the user launch their own jupyter instance, another solution to the problem is to install jupyterhub – a multi tenant jupyter server. I haven't tried it myself, but the project looks very interesting: github.com/jupyterhub/jupyterhub