Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit ipython notebook directory access

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.

like image 838
bosco- Avatar asked May 29 '14 14:05

bosco-


People also ask

How do I open a Jupyter Notebook in a specific folder?

Once you've entered your specific folder with Windows Explorer, you can simply press ALT + D, type in cmd and press Enter. You can then type jupyter notebook to launch Jupyter Notebook within that specific folder.

How do I give permission to a Jupyter Notebook?

You can set access control for Jupyter notebooks at the account level and at the object level. This feature is available in the latest version of Jupyter Notebooks. If you are not using the latest version of Jupyter notebooks, you can enable this feature from the Control Panel >> Account Features page.


1 Answers

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
like image 114
shad Avatar answered Oct 17 '22 06:10

shad