|
19 | 19 | "cell_type": "markdown",
|
20 | 20 | "metadata": {},
|
21 | 21 | "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.**" |
24 | 26 | ]
|
25 | 27 | },
|
26 | 28 | {
|
|
35 | 37 | "cell_type": "markdown",
|
36 | 38 | "metadata": {},
|
37 | 39 | "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`:" |
41 | 41 | ]
|
42 | 42 | },
|
43 | 43 | {
|
|
53 | 53 | "outputs": [
|
54 | 54 | {
|
55 | 55 | "output_type": "pyout",
|
56 |
| - "prompt_number": 4, |
| 56 | + "prompt_number": 1, |
57 | 57 | "text": [
|
58 |
| - "'sha1:12600d61acf2:3870d364759e268bc7076fd8843cdff1e2f1b683'" |
| 58 | + "'sha1:3d850b8981b3:73ccd5b832d131d9e30aa4cee84f7e619a154b15'" |
59 | 59 | ]
|
60 | 60 | }
|
61 | 61 | ],
|
62 |
| - "prompt_number": 4 |
| 62 | + "prompt_number": 1 |
63 | 63 | },
|
64 | 64 | {
|
65 | 65 | "cell_type": "markdown",
|
|
76 | 76 | ],
|
77 | 77 | "language": "python",
|
78 | 78 | "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 |
81 | 91 | },
|
82 | 92 | {
|
83 | 93 | "cell_type": "markdown",
|
|
106 | 116 | "cell_type": "markdown",
|
107 | 117 | "metadata": {},
|
108 | 118 | "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", |
112 | 122 | " \n",
|
113 | 123 | " \n",
|
114 | 124 | " openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.key -out mycert.crt"
|
|
130 | 140 | },
|
131 | 141 | {
|
132 | 142 | "cell_type": "heading",
|
133 |
| - "level": 1, |
| 143 | + "level": 2, |
134 | 144 | "metadata": {},
|
135 | 145 | "source": [
|
136 | 146 | "A public notebook"
|
|
156 | 166 | },
|
157 | 167 | {
|
158 | 168 | "cell_type": "heading",
|
159 |
| - "level": 1, |
| 169 | + "level": 2, |
160 | 170 | "metadata": {},
|
161 | 171 | "source": [
|
162 | 172 | "--no-browser"
|
|
167 | 177 | "metadata": {},
|
168 | 178 | "source": [
|
169 | 179 | "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", |
171 | 181 | "\n",
|
172 |
| - " $> ipython notebook --no-browser\n", |
| 182 | + " $ ipython notebook --no-browser\n", |
173 | 183 | "\n",
|
174 | 184 | "Or, to set this as your permanent default, add to you `ipython_notebook_config.py`:\n",
|
175 | 185 | "\n",
|
176 | 186 | " c.NotebookApp.open_browser = False"
|
177 | 187 | ]
|
178 | 188 | },
|
| 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 | + }, |
179 | 206 | {
|
180 | 207 | "cell_type": "code",
|
181 | 208 | "collapsed": false,
|
|
0 commit comments