Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for removing the New->Terminal menu entry. #3446

Closed
GrahamDumpleton opened this issue Mar 20, 2018 · 5 comments · Fixed by #3478
Closed

Option for removing the New->Terminal menu entry. #3446

GrahamDumpleton opened this issue Mar 20, 2018 · 5 comments · Fixed by #3478

Comments

@GrahamDumpleton
Copy link

There should be an official option for removing the New->Terminal menu entry.

This has been asked many times before, such as in jupyterhub/jupyterhub#1195, but also on StackOverflow and in other forums. The answer always get dismissed with the argument that people can execute code in the notebook anyway, or shell out a terminal command. That is quite valid when the kernel is run on the same host, or in the same container, as the Jupyter Notebook web interface, but when you are running a kernel on a remote host using the kernel_gateway and nb2kg packages, or enterprise kernel gateway, the terminal would be created on a different system to where the kernel is running.

In this case of using a kernel gateway, you don't necessarily want people to be able to create the terminal or even see the menu item, because it will run on the system where the Jupyter Notebook web interface is running, not where the kernel is running. You may want to prevent this, leaving the only place a user can run code being where the kernel is running.

The suggestion of uninstalling terminado package after it has been installed, or setting SHELL to /bin/false are both clunky solutions and don't get rid of the menu entry.

@takluyver
Copy link
Member

Yep, I think the option makes sense, I've just always been concerned when people ask for it that they're assuming disabling terminals is enough to secure a system against untrusted users.

Do you want to make a PR adding a config option to disable terminals?

@GrahamDumpleton
Copy link
Author

JavaScript, Tornado, and existing notebook code base is outside of my knowledge, so I would probably need a lot of guidance on this one to work out what to do. I suspect it isn't as simple as not showing the option in the menu item as you likely need to also ensure that certain URL handlers related to terminals are disabled if it is also possible to access a URL directly to create a terminal. Any guidance you can give on what needs to change?

@takluyver
Copy link
Member

It's probably relatively easy in this case, because the frontend stuff already has to handle the case where terminado isn't installed. So it just needs an explicit option to disable it. Have a look at the init_terminals method in notebookapp.py.

1 similar comment
@takluyver
Copy link
Member

It's probably relatively easy in this case, because the frontend stuff already has to handle the case where terminado isn't installed. So it just needs an explicit option to disable it. Have a look at the init_terminals method in notebookapp.py.

@takluyver
Copy link
Member

#3478 should fix this.

@takluyver takluyver added this to the 5.5 milestone Mar 28, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants