@@ -9,13 +9,46 @@ Notebook from the command line.
99
1010If you did install the Windows version or the macOS application you
1111should have icons available on your desktops or launching menus. Otherwise
12- you are strongly advised to create shortcuts for Sage as indicated as the end
12+ you are strongly advised to create shortcuts for Sage as indicated at the end
1313of the "Linux" Section in :ref: `sec-installation-from-binaries `. Assuming
14- that you have this shortcut, running ``sage `` in a console starts a Sage
15- session. To quit the session enter ``quit `` and then press ``<Enter> ``. To
16- start a Jupyter Notebook instead of a Sage console, run the command
17- ``sage -n jupyter `` instead of just ``sage ``. To quit the Jupyter Notebook
18- press ``<Ctrl> + <c> `` twice in the console where you launched the command.
14+ that you have this shortcut, running
15+
16+ .. CODE-BLOCK :: bash
17+
18+ sage
19+
20+ in a console starts a Sage session. To quit the session enter ``quit `` and
21+ then press ``<Enter> ``.
22+
23+ To start a Jupyter Notebook instead of a Sage console, run the command
24+
25+ .. CODE-BLOCK :: bash
26+
27+ sage -n jupyter
28+
29+ instead of just ``sage ``. To quit the Jupyter Notebook press ``<Ctrl> + <c> ``
30+ twice in the console where you launched the command.
31+
32+ Using a Jupyter Notebook remotely
33+ ---------------------------------
34+
35+ If Sage is installed on a remote machine to which you have ``ssh `` access, you
36+ can launch a Jupyter Notebook using a command such as
37+
38+ .. CODE-BLOCK :: bash
39+
40+ ssh -L localhost:8888:localhost:8888 -t USER@REMOTE sage -n jupyter --no-browser --port=8888
41+
42+ where ``USER@REMOTE `` needs to be replaced by the login details to the remote
43+ machine. This uses local port forwarding to connect your local machine to the
44+ remote one. The command will print a URL to the console which you can copy and
45+ paste in a web browser.
46+
47+ Note that this assumes that a firewall which might be present between server
48+ and client allows connections on port 8888. See details on port forwarding on
49+ the internet, e.g. https://www.ssh.com/ssh/tunneling/example.
50+
51+ ------------------------------------------------------------------------
1952
2053For further reading you can have a look at the other documents in the
2154SageMath documentation at http://doc.sagemath.org/.
0 commit comments