Skip to content

Commit e6bb3b2

Browse files
committed
Updating secure notebook tut.
1 parent 28a058e commit e6bb3b2

File tree

1 file changed

+44
-17
lines changed

1 file changed

+44
-17
lines changed

notebooks/Running a Secure Public Notebook.ipynb

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
"cell_type": "markdown",
2020
"metadata": {},
2121
"source": [
22-
"Sometimes you want to run a notebook on a publicly visible interface.\n",
23-
"Since the notebook lets you run arbitrary code as you, an HTTP connection with no authentication isn't exactly wise."
22+
"Sometimes you want to run a notebook on a publicly visible network interface.\n",
23+
"Since the notebook lets you run arbitrary code as you, an HTTP connection with no authentication isn't exactly wise.\n",
24+
"This Notebook shows you how to run the IPython Notebook server to allow **trusted users** to access the Notebook\n",
25+
"on a remote, public server. **Untrusted users should never be given access to the Notebook.**"
2426
]
2527
},
2628
{
@@ -35,9 +37,7 @@
3537
"cell_type": "markdown",
3638
"metadata": {},
3739
"source": [
38-
"For this, the IPython Notebook can be secured with a simple password,\n",
39-
"which you add to your config files. You don't put the password itself into you config file,\n",
40-
"rather the salted / hashed password generated by `IPython.lib.passwd`"
40+
"First, the IPython Notebook should be secured with a password, which you add to your config files. You don't put the password itself into you config file, rather the salted / hashed password generated by `IPython.lib.passwd`:"
4141
]
4242
},
4343
{
@@ -53,13 +53,13 @@
5353
"outputs": [
5454
{
5555
"output_type": "pyout",
56-
"prompt_number": 4,
56+
"prompt_number": 1,
5757
"text": [
58-
"'sha1:12600d61acf2:3870d364759e268bc7076fd8843cdff1e2f1b683'"
58+
"'sha1:3d850b8981b3:73ccd5b832d131d9e30aa4cee84f7e619a154b15'"
5959
]
6060
}
6161
],
62-
"prompt_number": 4
62+
"prompt_number": 1
6363
},
6464
{
6565
"cell_type": "markdown",
@@ -76,8 +76,18 @@
7676
],
7777
"language": "python",
7878
"metadata": {},
79-
"outputs": [],
80-
"prompt_number": 6
79+
"outputs": [
80+
{
81+
"output_type": "stream",
82+
"stream": "stdout",
83+
"text": [
84+
"[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_nbssl/ipython_config.py'\r\n",
85+
"[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_nbssl/ipython_qtconsole_config.py'\r\n",
86+
"[ProfileCreate] Generating default config file: u'/Users/bgranger/.ipython/profile_nbssl/ipython_notebook_config.py'\r\n"
87+
]
88+
}
89+
],
90+
"prompt_number": 2
8191
},
8292
{
8393
"cell_type": "markdown",
@@ -106,9 +116,9 @@
106116
"cell_type": "markdown",
107117
"metadata": {},
108118
"source": [
109-
"Now that we have secured our notebook with a password,\n",
110-
"we probably want to encrypt traffic with HTTPS.\n",
111-
"To run the notebook over https, we need to generate a key and self-signed certificate:\n",
119+
"Now that we have secured our notebook with a password, we need to encrypt traffic with HTTPS.\n",
120+
"To run the notebook over HTTPS, we need to generate a key and self-signed certificate. Run the following in the \n",
121+
"`nbssl` profile directory:\n",
112122
" \n",
113123
" \n",
114124
" openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.key -out mycert.crt"
@@ -130,7 +140,7 @@
130140
},
131141
{
132142
"cell_type": "heading",
133-
"level": 1,
143+
"level": 2,
134144
"metadata": {},
135145
"source": [
136146
"A public notebook"
@@ -156,7 +166,7 @@
156166
},
157167
{
158168
"cell_type": "heading",
159-
"level": 1,
169+
"level": 2,
160170
"metadata": {},
161171
"source": [
162172
"--no-browser"
@@ -167,15 +177,32 @@
167177
"metadata": {},
168178
"source": [
169179
"When you are starting the notebook on a remote server (or just in general),\n",
170-
"you may not want to launch the browser as well. For this, you can add at the command-line:\n",
180+
"you may not want to launch the browser automatically. For this, you can add at the command-line:\n",
171181
"\n",
172-
" $> ipython notebook --no-browser\n",
182+
" $ ipython notebook --no-browser\n",
173183
"\n",
174184
"Or, to set this as your permanent default, add to you `ipython_notebook_config.py`:\n",
175185
"\n",
176186
" c.NotebookApp.open_browser = False"
177187
]
178188
},
189+
{
190+
"cell_type": "heading",
191+
"level": 2,
192+
"metadata": {},
193+
"source": [
194+
"Running the Notebook"
195+
]
196+
},
197+
{
198+
"cell_type": "markdown",
199+
"metadata": {},
200+
"source": [
201+
"To start the Notebook server using this profile, run the following:\n",
202+
"\n",
203+
" $ ipython notebook --profile=nbssl"
204+
]
205+
},
179206
{
180207
"cell_type": "code",
181208
"collapsed": false,

0 commit comments

Comments
 (0)