Jupyter Hub - AWS
  • Overview
  • Pre-requisites
  • Disclaimer
  • AWS: Instance Launching
    • Overview
    • Customizing an Instance
    • Assigning an Elastic IP Address
    • Connecting to Your Cloud
    • Ubuntu: Server Update and Add Users
  • Anaconda
    • Overview
    • Anaconda Installation
    • JupyterHub Installation and Configuration
  • R
    • R Installation
    • Update and Install IR Kernel
  • Stata
    • Overview
    • Stata Installation
    • Stata Kernel for Jupyter
  • (Optional) GitHub Extension and Packages
    • GitHub Extension
    • nbgrader
  • (Optional) Add a Custom Domain
    • Overview
    • Adding a Subdomain
  • (Optional) GitHub Authentication
    • Overview
    • Generate Cookie Secret
    • Secure Your Lab
    • Add GitHub Authentication
Powered by GitBook
On this page
  1. (Optional) GitHub Authentication

Generate Cookie Secret

PreviousOverviewNextSecure Your Lab

Last updated 3 years ago

Encrypt your lab's for security purposes:

Obtain administrative rights by requesting root access:

sudo -i

Create a new directory for the cookie secret:

mkdir /srv/jupyterhub

Generate a random number and save it as the cookie secret:

openssl rand -hex 32 > /srv/jupyterhub/jupyterhub_cookie_secret

Edit JupyterHub's configuration file:

nano /etc/jupyterhub/jupyterhub_config.py

Copy the following and add it to the file:

c.JupyterHub.cookie_secret_file = '/srv/jupyterhub/jupyterhub_cookie_secret'

Use CTRL+O then enter to overwrite the document and CTRL+X to exit.

Ensure that only the system administrator can read and write the cookie secret:

chmod 600 /srv/jupyterhub/jupyterhub_cookie_secret

Restart to ensure recognition of the new extension:

systemctl restart jupyterhub.service
cookie