question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable terminals in TLJH

See original GitHub issue

Hi,

I was trying to disable the terminals as described in Custom jupyterhub_config.py snippets but for some reason it did not work for me.

I created a python file named jupyterhub_noterminals_config.py in /opt/tljh/config/jupyterhub_config.d with file permissions -rw-r--r-- (owner is root) and containing the single line: c.NotebookApp.terminals_enabled = False

When I reload the configuration with sudo tljh-config reload the terminals are still visible for existing and new users. The terminals are also enabled for all users when I reboot. I found no obvious error message in the JupyterHub logs.

The only way I managed to disable terminals was to change both boolean parameters in line 1282 in /opt/tljh/user/lib/python3.6/site-packages/notebook/notebookapp.py from True to False and then reboot.

What did I miss?

Thank you in advance.

ps1: installed TLJH with bootstrap.py (commit 8ec3fab) ps2# Related issue in jupyterhub

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
woschmidcommented, Jun 14, 2019

Hi,

Thanks to your hint I found a solution:

  1. I enabled the terminals again in order to execute the following commands in the terminal of the administrator user in TLJH
  2. I searched for the config paths using the command jupyter --paths (mentioned in this issue)
  3. I generated a config file jupyter_notebook_config.py using the command jupyter notebook --generate-config (described here). This file is generated into the admin’s .jupyter directory (listed first in the config paths)
  4. I enabled the line c.NotebookApp.terminals_enabled = True in the generated jupyter_notebook_config.py
  5. I copied this file using sudo to /opt/tljh/user/etc/jupyter (listed second in the config paths) and changed it’s entry from True to False
  6. Reboot the server (is there a better way?)
  7. Now the TLJH administrator user has access to a terminal and all normal users have no terminal
1reaction
yuvipandacommented, Jun 14, 2019

@woschmid awesome! Glad you have that working 😃

Starting and stopping a user’s server should work instead of having to reboot the machine, since notebook server reads the config on each start.

I’m going to close this now since we’ve figured out what works for you. Thank you for posting a detailed solution for the next person who finds this issue! ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Terminals and shell script in TLJH
I want to know how to disable terminals and shell script in TLJH . I tried to use " jupyter_notebook_config.py " with “c....
Read more >
Customizing the JupyterHub environment (TLJH)
From inside a terminal in JupyterHub while logged in as an admin user. This method is recommended. By directly calling /opt/tljh/hub/bin/tljh-config as root ......
Read more >
Setting a JupyterHub for the lab
If apache is enabled on the server. we disable it. ... If JupyterHub is up and running, then open a terminal and install...
Read more >
For educators — NI-edu - Lukas Snoek
Then, run sudo tljh-config reload proxy and finally close port 80 again by running sudo ufw delete allow 80 . Finally, Jupyterhub communicates...
Read more >
Disabling terminal access? - Google Groups
Disable root access on that terminal? (Maybe I started the Jupyter Notebook server as service with root privilege).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found