13

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 1

14

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 ipython user that doesn't belong to any existing user groups
  • Create a folder for the ipython user (cloud for instance)
  • Launch the iPython notebook as ipython in the cloud folder
Sign up to request clarification or add additional context in comments.

2 Comments

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?
@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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.