[sage-support] Re: Running Sage remotely via web browser w/ firewall enabled(?)

2010-06-29 Thread Nils Bruin
You could use ssh to tunnel through the firewall:

http://groups.google.ca/group/sage-devel/browse_thread/thread/936f563a4984a80/7b9b015c777fdb64

the only extra exposure you get then is that any person who can log in
to your machine, can execute code with the privileges that the sage
server runs with.

I use

ssh -X -L 8000:localhost:8000 server
server> sage
> notebook()

to run a personal notebook on "server". Thanks to the x forwarding, it
can even open the browser window automatically.
This could potentially be quite secure if the server process does not
accept any further connections.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Running Sage remotely via web browser w/ firewall enabled(?)

2010-06-29 Thread Dr. David Kirkby

On 06/30/10 01:55 AM, rvaug...@gmail.com wrote:

I am running Sage 4.3.4 on Scientific Linux.
Right now the only way I can make it available
via a web browser is to disable the firewall
(not, obviously, a long-term solution).

I have SELinux as permissive, and the following
as trusted services: HTTP, HTTPS, FTP&  SSH.

I execute from the sage prompt as follows:
sage: notebook(address="",open_viewer=False)

The output I receive is appended.

Any thoughts on what I need to do to make sage
available via web browser and *not* disable the firewall?
And any thoughts on the warnings within the output?

Thanks,
-Richard Vaughn


You should be able to open your firewall to just the port Sage uses (8000 by 
default).


In order to run Sage running on port 80 or 443 you would need to start it as 
root, so that would be a bad idea.


I think people do things like proxy sage via apache. I don't know anything about 
that myself. I've not done it often, but when I have, I've run Sage at the 
default port of 8000 and would open the firewall up on that port only.


Note, when you run a Sage sever, you make it very easy for a user to get a 
normal shell prompt and run any arbitrary command.


So running Sage on systems where security is a concern needs some thought given 
to it.


Dave

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Running Sage remotely via web browser w/ firewall enabled(?)

2010-06-29 Thread rvaug...@gmail.com
I am running Sage 4.3.4 on Scientific Linux.
Right now the only way I can make it available
via a web browser is to disable the firewall
(not, obviously, a long-term solution).

I have SELinux as permissive, and the following
as trusted services: HTTP, HTTPS, FTP & SSH.

I execute from the sage prompt as follows:
sage: notebook(address="",open_viewer=False)

The output I receive is appended.

Any thoughts on what I need to do to make sage
available via web browser and *not* disable the firewall?
And any thoughts on the warnings within the output?

Thanks,
-Richard Vaughn

= output ==
/usr/share/sage-4.3.4/local/bin/sage-ipython:1: DeprecationWarning:
Use 'interface' instead of 'address' when calling notebook(...).
  #!/usr/bin/env python
**
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 interface.
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 *
**
**
2010-06-29 12:51:29-0400 [-] Log opened.
2010-06-29 12:51:29-0400 [-] twistd 9.0.0 (/usr/share/sage-4.3.4/local/
bin/python 2.6.4) starting up.
2010-06-29 12:51:29-0400 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2010-06-29 12:51:29-0400 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2010-06-29 12:51:29-0400 [-] Starting factory


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] solving equations with constrains

2010-06-29 Thread Johannes
Hi list,
i have some equatione, wich i want to solove using the solve function:

q0,q1,q2,q3 = var("q0,q1,q2,q3")
eq = (q0 - q3, q1 - q3, q2 - q3)
solve(eq,q0,q1,q2,q3) returns
[[q1 == r5, q2 == r5, q3 == r5, q0 == r5]]
this is correct, but i want to have r5 in \N r5 \neq 0 with
gcd(q1,q2,q3,q0) = 1, meaninga in this case, r5 = 1.

i tried to extend eq to
eq = [(q0  * v0 ) + (q1 * v1) + (q2 * v2) + (q3 * v3) , gcd(q0,q1) == 1,
gcd(q1,q2) == 1, gcd(q2,q3) == 1]
and i get this:
[[q1 == r8, q2 == r7, q3 == r7, q0 == r6]]
thats not even waht i want to have.

how do i have to do it?

greatz Johannes

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org