Is there a way to disable shell and system OS execution?

703 views
Skip to first unread message

Hoc Phan

unread,
Feb 3, 2016, 3:41:34 PM2/3/16
to Project Jupyter
Is it possible to prevent people from using exclamation mark (!ls /) to run shell command line?

Second question, is it possible to prevent from using Python (os, system) to run any OS command line?

I guess the easy way is to run Docker container for each notebook, where the user can do whatever they want. I think that's how try.jupyter.org and Kaggle does. But if there is a way to prevent shell in general, that'd be great. Please advise.

Thomas Kluyver

unread,
Feb 3, 2016, 5:49:42 PM2/3/16
to Project Jupyter
There is no practical way I know of to block the user from running system commands. And even if there was, almost anything that you can do with a shell, you can also do from Python code.

If you are letting untrusted users execute code on your system, the only sane approach is to run inside some kind of container without access to the system outside the container.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/7dec4144-f505-498f-b6da-dfc14987370d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages