sage: notebook()
which returned:
Open your web browser to http://localhost:8000
There must be some incantation for starting a sage server that can be
connected
to over the web remotely from outside the Sage server, right?
Thoughts/suggestions/experience?
Thanks,
-Richard Vaughn
Yes, it can be done. I don't remember the exact incantation, but Try
typing
sage: notebook?
- Robert
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>
--
Christopher Olah
Email: christoph...@gmail.com
The notebook only listens on localhost by default. Use
sage: notebook(address="")
to listen on any port...
William
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
sage:
I then add the following after the "sage:" prompt:
notebook(address="192.NN.NN.NNN")
where 192.NN.NN.NNN is the IP address of the machine of...
the client machine from which I want to run sage remotely via a
browser?
or the 'server' machine on which the Sage instance is running?
Thanks,
-Richard Vaughn
On Dec 19, 12:49 am, William Stein <wst...@gmail.com> wrote:
> On Fri, Dec 18, 2009 at 9:35 PM, Christopher Olah
>
> <christopherolah...@gmail.com> wrote:
> > I'm not sure I understand. Why can't you just use ${IP ADDRESS}:8000 ?
> > You'll probably need to port-forward, but that is easy enough...
>
> The notebook only listens on localhost by default. Use
>
> sage: notebook(address="")
>
> to listen on any port...
>
> William
>
>
>
>
>
> > On Fri, Dec 18, 2009 at 6:09 PM, Robert Bradshaw
> > <rober...@math.washington.edu> wrote:
> >> On Dec 18, 2009, at 2:53 PM, rvaug...@gmail.com wrote:
>
> >>> On a newly-installed instance of Sage, one of my users ssh's in and
> >>> runs "sage".
> >>> He gets this:
>
> >>> sage: notebook()
> >>> which returned:
> >>> Open your web browser tohttp://localhost:8000
>
> >>> There must be some incantation for starting a sage server that can be
> >>> connected
> >>> to over the web remotely from outside the Sage server, right?
>
> >>> Thoughts/suggestions/experience?
>
> >> Yes, it can be done. I don't remember the exact incantation, but Try
> >> typing
>
> >> sage: notebook?
>
> >> - Robert
>
> >> --
> >> To post to this group, send email to sage-s...@googlegroups.com
> >> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> >> For more options, visit this group athttp://groups.google.com/group/sage-support
> >> URL:http://www.sagemath.org
>
> > --
> > Christopher Olah
> > Email: christopherolah...@gmail.com
>
> > --
> > To post to this group, send email to sage-s...@googlegroups.com
> > To unsubscribe from this group, send email to sage-support...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sage-support
To repeat what I wrote above:
The notebook only listens on localhost by default. Use
sage: notebook(address="", open_viewer=False)
So now how does a remote user access this Sage instance
via his browser? What would the URL be?
Thanks very much,
-Richard Vaughn
======================================================================
sage: notebook(address="", open_viewer=False)
**********************************************************************
WARNING: Running the notebook insecurely not on localhost is dangerous
because its possible for people to sniff passwords and gain access to
your account. Make sure you know what you are doing.
**********************************************************************
The notebook files are stored in: sage_notebook.sagenb
**********************************************************************
WARNING: Insecure notebook server listening on external address.
Unless you are running this via ssh port forwarding, you are
**crazy**! You should run the notebook with the option secure=True.
**********************************************************************
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
Removing stale pidfile /home/rvaughn/.sage/sage_notebook.sagenb/
twistd.pid
2009-12-21 15:16:51-0500 [-] Log opened.
2009-12-21 15:16:51-0500 [-] twistd 8.2.0 (/usr/share/sage-4.2.1/local/
bin/python 2.6.2) starting up.
2009-12-21 15:16:51-0500 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2009-12-21 15:16:51-0500 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2009-12-21 15:16:51-0500 [-] Starting factory
<twisted.web2.channel.http.HTTPFactory instance at 0x2ab1ce8d40>
On Dec 21, 2:42 pm, William Stein <wst...@gmail.com> wrote:
If the ip address of the computer you run Sage on is foo.bar, you would use
William
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
ssh'd to Sage server as normal (non-root) user, started sage. At sage
prompt:
sage: notebook(address="",open_viewer=False)
This produced the output appended.
Then, in a browser on a separate Linux machine,
I entered a URL of http://128.N.NN.NNN:8000/,
where 128.N.NN.NNN is the IP address of the Sage server.
In trying to connect, the browser then displays the following:
"Failed to Connect
Firefox can't establish a connection to the server at
128.N.NN.NNN:8000.
Though the site seems valid, the browser was unable to establish
a connection.
* Could the site be temporarily unavailable? Try again later.
* Are you unable to browse other sites? Check the computer's
network connection.
* Is your computer or network protected by a firewall or proxy?
Incorrect settings can interfere with Web browsing."
Is there something I'm not doing, or doing incorrectly?
Thanks again for the help,
-Richard Vaughn
**********************************************************************
WARNING: Running the notebook insecurely not on localhost is dangerous
because its possible for people to sniff passwords and gain access to
your account. Make sure you know what you are doing.
**********************************************************************
The notebook files are stored in: sage_notebook.sagenb
**********************************************************************
WARNING: Insecure notebook server listening on external address.
Unless you are running this via ssh port forwarding, you are
**crazy**! You should run the notebook with the option secure=True.
**********************************************************************
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
2009-12-22 09:43:35-0500 [-] Log opened.
2009-12-22 09:43:35-0500 [-] twistd 8.2.0 (/usr/share/sage-4.2.1/local/
bin/python 2.6.2) starting up.
2009-12-22 09:43:35-0500 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2009-12-22 09:43:35-0500 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2009-12-22 09:43:35-0500 [-] Starting factory
<twisted.web2.channel.http.HTTPFactory instance at 0x2ab1ce8d40>
On Dec 21, 4:19 pm, William Stein <wst...@gmail.com> wrote:
> > For more options, visit this group athttp://groups.google.com/group/sage-support
You are doing everything right on generic system without a firewall.
Maybe your remote system has a firewall or something.
William
> For more options, visit this group at http://groups.google.com/group/sage-support
By "remote system" you mean the 'client',
ie, *not* the machine on which Sage is running?
On Dec 22, 11:56 am, William Stein <wst...@gmail.com> wrote:
> On Tue, Dec 22, 2009 at 6:55 AM, rvaug...@gmail.com <rvaug...@gmail.com> wrote:
> > OK, here's what I did and here's what happened.
>
> > ssh'd to Sage server as normal (non-root) user, started sage. At sage
> > prompt:
>
> > sage: notebook(address="",open_viewer=False)
>
> > This produced the output appended.
>
> > Then, in a browser on a separate Linux machine,
> > I entered a URL ofhttp://128.N.NN.NNN:8000/,
sage: notebook(address="",open_viewer=False, secure = True)
and then use
instead of http. But William understands these issues better than
I.
-M. Hampton
By remote system I mean the machine on which Sage is running. It is
remote = "far away, distant".
> For more options, visit this group at http://groups.google.com/group/sage-support
If the OP has a firewall setup then the above won't work for the same
reason. I've never seen a situation where using secure https works
whereas insecure http does not work. The OP started this thread
with "On a newly-installed instance of Sage, one of my users ssh's in
and runs "sage"." This suggests he is a sysadmin and hence probably
knows the answers to the following questions:
(1) What Linux distribution is the computer running?
(2) Does it have a firewall setup?
-- William
I just got it to work remotely after disabling the firewall
on the machine running Sage and then re-booting.
That is considerable progress.
However: I'm obviously not crazy about running
my machine w/ the firewall disabled.
Is there a way to config the firewall such that
the firewall is enabled AND Sage can be run remotely?
Possibly specify WWW (HTTP) and/ or Secure WWW (HTTPS)
as Trusted Services?
Thanks,
-Richard Vaughn
On Dec 22, 12:53 pm, William Stein <wst...@gmail.com> wrote:
I just got it to work remotely after disabling the firewall
on the machine running Sage and then re-booting.
That is considerable progress.
However: I'm obviously not crazy about running
my machine w/ the firewall disabled.
Is there a way to config the firewall such that
the firewall is enabled AND Sage can be run remotely?
Possibly specify WWW (HTTP) and/ or Secure WWW (HTTPS)
as Trusted Services?
Thanks,
-Richard Vaughn
On Dec 22, 12:53 pm, William Stein <wst...@gmail.com> wrote:
I just got it to work remotely after disabling the firewall
on the machine running Sage and then re-booting.
That is considerable progress.
However: I'm obviously not crazy about running
my machine w/ the firewall disabled.
Is there a way to config the firewall such that
the firewall is enabled AND Sage can be run remotely?
Possibly specify WWW (HTTP) and/ or Secure WWW (HTTPS)
as Trusted Services?
Thanks,
-Richard Vaughn
On Dec 22, 12:53 pm, William Stein <wst...@gmail.com> wrote:
I don't use Linux, so I don't know the syntax for the firewall. But any
half-reasonable firewall will allow you to open only a specific port.
On t2.math.washington.edu (Solaris machine) I set up a firewall, the first few
lines of which are:
block in all
block out all
# Allow only SSH access (that's port 22, TCP)
pass in quick proto tcp from any to 128.208.128.194 port = 22 keep state
That basically says first block everything coming in, then block everything
going out, then the next line says to open port 22 from any IP address to the IP
128.208.128.194. The 'keep state' means that the required outgoing port (a
random port >=1024) is opened for outgoing traffic.
So essentially, you should be able to do something similar, but only open port
8000.
I believe most linux distros use 'ipchains'. In which case, look at the
documentation. There must be something about running a web server. All you need
to do is change the example to use port 8000 rather than 80 (web) or 22 (ssh).
However, in general, unless your machine was ONLY a Sage server, you have to
open other ports too.
Dave
You can specifically allow a user to open port 8000 (say), but no
other ports. How you do this depends on the specific firewall
you're running. You might want to do some google searches, read
documentation, or ask in a Linux forum...
William
You can specifically allow a user to open port 8000 (say), but no
System-level configuration is not uniform across Linux distributions, so
without knowing what particular distribution you are using it is hard to
give you precise advice.
For instance, my distribution is Archlinux, and I just use the simple
host access control specified by /etc/hosts.allow and /etc/hosts.deny.
The syntax of these is fairly simple and "man hosts.allow" tells me all
about it. I would for instance put
in /etc/hosts.deny:
ALL: ALL
to deny all requests by default, together with
in /etc/hosts.allow:
SSHD: ALL
to let all ssh login requests through.
I don't need an elaborate firewall setup because this is just my laptop
sitting on my behind a router that also only allows ssh through.
Someone running a Linux server might use iptables to set up a proper
firewall with more complicated rules. So what I would do in your
situation is to find out what firewall software is enabled on your
machine and then google "XYZ ABC configuration", where XYZ is your Linux
distribution and ABC is the firewall software.
Best,
Alex
--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/
Almost any linux distro has iptables installed, and it's very easy to
find examples (see https://help.ubuntu.com/community/IptablesHowTo, for
example). Recently I found ufw (for uncomplicated firewall), which comes
with an really simple grafical interface: gufw. You don't need a
tutorial to use gufw.
Are you saying iptables allows you to open a port (8000), but only Sage can use
that port, and not another process that run at port 8000? If so, that is
something ipfilter can't do to my knowledge.
If port 8000 is opened, then any process that listens on port 8000 can run as a
server. But of course, once the first process opens port 8000, nothing else can
open the port. So one can't eavesdrop by creating another monitor of port 8000.
My Dad has a dynamic IP address. Using dydns.org, he has a fixed domain name. I
use that to get his IP address, then update the firewall every 10 minutes. So if
I visit him, I can always SSH into my machine from his place, but nowhere else.
Creating a firewall which dynamically changes is probably not possible with a GUI!
Dave
Yes, I'm sure. Turns out that ufw is just a simpler interface to
iptables, and ufw allows that:
sudo ufw allow <service name>
(that was from https://help.ubuntu.com/community/UFW#Allow%20and%20Deny)
> Creating a firewall which dynamically changes is probably not possible
> with a GUI!
/etc/hosts.allow does allow to include either IPs, or domain names. But
if the IP can change, you can end up blocking the current ip and
allowing for a different one, so you have to do as you do. But once
you've solved it, it can be a feature in a GUI any day.
Regards
Another question:
We'd like the "sage: notebook(address="",open_viewer=False, secure =
True) "
to be executed on boot-up so that it's "there" when anyone wants it.
Any suggestions on how? /etc/init.d/{script}?
Thanks,
-Richard Vaughn
On Dec 23, 4:03 am, Pablo Angulo <pablo.ang...@uam.es> wrote:
> > Are you saying iptables allows you to open a port (8000), but only
> > Sage can use
> > that port, and not another process that run at port 8000? If so, that is
> > something ipfilter can't do to my knowledge.
>
> Yes, I'm sure. Turns out that ufw is just a simpler interface to
> iptables, and ufw allows that:
>
> sudo ufw allow <service name>
>
> (that was fromhttps://help.ubuntu.com/community/UFW#Allow%20and%20Deny)
I run my first 'public' server yesterday, so my experience is pretty small, but
I suspect something like a startup script with
su - sage /homes/sage/sage-4.2/sage -notebook address=''
server_pool=['sage1@localhost'] ulimit='-v 500000' accounts=True
should start the process as non-root. However, there are too many quotes in that
command - I need to sort out exactly how to specify those things on the command
line. There might needs to be some double quotes/ quotes removed / or similar.
Whatever you do, don't start as root. That is what my 'su' bit does above -
switches to another user.
dave
Just make a script in /usr/local/bin/, e.g.,
/usr/local/bin/start_sage_server
put something like this in it:
/homes/sage/sage-4.2/sage -notebook address='' accounts=True
Then edit
/etc/rc.d/rc.local
(or whatever it is for you Linux distro! which is it?)
and put
su - sage /usr/local/bin/start_sage_server
William
I created a script like you said, though since it was for test, I stuck it in /tmp.
Anyway, here's my script.
-bash-3.00$ cat /tmp/start_sage_server
#!/bin/sh
/homes/sage/sage-4.2/sage -notebook address='' server_pool=['sage1@localhost']
ulimit='-v 500000' accounts=True
Here is the output from Sage. Is this normal? They syntax is quite around the :
notebook(address=r'''''',server_pool=r'''[sage1@localhost]''',ulimit=r'''-v
500000''',accounts=True)
is different to what I'd type to start the notebook at the sage: prompt. I think
you can see my concern about whether there are extra quotes here. Where does the
latter 'r' come from, after the address= and after the serverpool=?
-bash-3.00$ /tmp/start_sage_server
----------------------------------------------------------------------
| Sage Version 4.2.1, Release Date: 2009-11-14 |
| |
| Built on Solaris 10 03/2005 so will run on any Solaris 10 system |
| Note, at this point in time, Sage on Solaris is somewhat |
| experimental, having not had extensive testing. |
| |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Please wait while the Sage Notebook server starts...
...
notebook(address=r'''''',server_pool=r'''[sage1@localhost]''',ulimit=r'''-v
500000''',accounts=True)
**********************************************************************
WARNING: Running the notebook insecurely not on localhost is dangerous
because its possible for people to sniff passwords and gain access to
your account. Make sure you know what you are doing.
**********************************************************************
The notebook files are stored in: sage_notebook.sagenb
**********************************************************************
WARNING: Insecure notebook server listening on external address.
Unless you are running this via ssh port forwarding, you are
**crazy**! You should run the notebook with the option secure=True.
**********************************************************************
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
/homes/sage/sage-4.2/local/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-solaris-2.10-sun4u.egg/twisted/internet/_sslverify.py:5:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
import itertools, md5
2009-12-24 04:25:46+0000 [-] Log opened.
2009-12-24 04:25:46+0000 [-] twistd 8.2.0 (/homes/sage/sage-4.2/local/bin/python
2.6.2) starting up.
2009-12-24 04:25:46+0000 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2009-12-24 04:25:46+0000 [-] twisted.web2.channel.http.HTTPFactory starting on 8000
2009-12-24 04:25:46+0000 [-] Starting factory
<twisted.web2.channel.http.HTTPFactory instance at 0x38830d0>
/homes/sage/sage-4.2/local/bin/sage-native-execute: xdg-open: not found
John
On Dec 24, 4:38 am, "Dr. David Kirkby" <david.kir...@onetel.net>
wrote:
> William Stein wrote:
> > On Wed, Dec 23, 2009 at 12:42 PM, Dr. David Kirkby
> > <david.kir...@onetel.net> wrote: