Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22482 > unrolled thread

Python Script Works Locally But Not Remotely with SSH

Started bygoldtech <goldtech@worldpost.com>
First post2012-03-27 17:51 -0700
Last post2012-04-02 19:17 -0400
Articles 7 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Python Script Works Locally But Not Remotely with SSH goldtech <goldtech@worldpost.com> - 2012-03-27 17:51 -0700
    Re: Python Script Works Locally But Not Remotely with SSH goldtech <goldtech@worldpost.com> - 2012-04-01 10:32 -0700
    Re: Python Script Works Locally But Not Remotely with SSH Jedrzej Krzysztof Dec <jdec@jedrzejdec.eu> - 2012-04-01 12:32 -0700
      Re: Python Script Works Locally But Not Remotely with SSH Rod Person <rodperson@rodperson.com> - 2012-04-03 07:37 -0400
        Re: Python Script Works Locally But Not Remotely with SSH goldtech <goldtech@worldpost.com> - 2012-04-07 09:59 -0700
    Re: Python Script Works Locally But Not Remotely with SSH Emile van Sebille <emile@fenx.com> - 2012-04-02 14:04 -0700
    Re: Python Script Works Locally But Not Remotely with SSH Jerry Hill <malaclypse2@gmail.com> - 2012-04-02 19:17 -0400

#22482 — Python Script Works Locally But Not Remotely with SSH

Fromgoldtech <goldtech@worldpost.com>
Date2012-03-27 17:51 -0700
SubjectPython Script Works Locally But Not Remotely with SSH
Message-ID<2750c67d-859f-46a3-ab00-a8a3da06cc4c@l14g2000vbe.googlegroups.com>
Hi,

I have a WinXP PC running an SSH server and I have a Linux PC with an
SSH client  and logged into the XP seemingly OK. It's all on my
personal LAN, the connection seems OK.

I have a py file on the XP that I run via SSH from the Linux, it's:

import webbrowser
webbrowser.open('www.google.com')

This runs OK started on the local XP PC, the browser Firefox opens and
goes to the site, or it opens a tab to the site. But executing that
same file via SSH does not open Firefox...doing it via SSH starts
Firefox ( I see it begin in the process manager and I see web
activity) but Firefox does not open it's window.

Why the does the window not open when the script is started remotely?

Thanks.

[toc] | [next] | [standalone]


#22525

Fromgoldtech <goldtech@worldpost.com>
Date2012-04-01 10:32 -0700
Message-ID<dd91fdd2-508b-4908-a785-0ee543f4aeea@l30g2000yqb.googlegroups.com>
In reply to#22482
Bump(?)

[toc] | [prev] | [next] | [standalone]


#22526

FromJedrzej Krzysztof Dec <jdec@jedrzejdec.eu>
Date2012-04-01 12:32 -0700
Message-ID<12051938.18.1333308736916.JavaMail.geo-discussion-forums@vbtb5>
In reply to#22482
On Wednesday, March 28, 2012 2:51:37 AM UTC+2, goldtech wrote:
> Hi,
> 
> I have a WinXP PC running an SSH server and I have a Linux PC with an
> SSH client  and logged into the XP seemingly OK. It's all on my
> personal LAN, the connection seems OK.
> 
> I have a py file on the XP that I run via SSH from the Linux, it's:
> 
> import webbrowser
> webbrowser.open('www.google.com')
> 
> This runs OK started on the local XP PC, the browser Firefox opens and
> goes to the site, or it opens a tab to the site. But executing that
> same file via SSH does not open Firefox...doing it via SSH starts
> Firefox ( I see it begin in the process manager and I see web
> activity) but Firefox does not open it's window.
> 
> Why the does the window not open when the script is started remotely?
> 
> Thanks.

Do You have a GUI over SSH? Something like ssh -X in Linux systems, or do You just have a terminal window? If You just have a terminal, You wont be able to run GUI apps.

Rgrds

[toc] | [prev] | [next] | [standalone]


#22586

FromRod Person <rodperson@rodperson.com>
Date2012-04-03 07:37 -0400
Message-ID<mailman.1268.1333453566.3037.python-list@python.org>
In reply to#22526
On Sun, 1 Apr 2012 12:32:16 -0700 (PDT)
Jedrzej Krzysztof Dec <jdec@jedrzejdec.eu> wrote:
> > 
> > Why the does the window not open when the script is started
> > remotely?
> > 
> > Thanks.
> 
> Do You have a GUI over SSH? Something like ssh -X in Linux systems,
> or do You just have a terminal window? If You just have a terminal,
> You wont be able to run GUI apps.
> 


You need an X server on the XP machine. I've use Xming for this.
http://sourceforge.net/projects/xming/?_test=b


-- 

Rod Person  http://www.rodperson.com  rodperson@rodperson.com

'Silence is a fence around wisdom'

[toc] | [prev] | [next] | [standalone]


#22767

Fromgoldtech <goldtech@worldpost.com>
Date2012-04-07 09:59 -0700
Message-ID<57e3fe20-f206-4430-be96-126d28f7fe25@l30g2000yqb.googlegroups.com>
In reply to#22586
Thank you for the help.

I guess I didn't understand what's really going on. I thought if I SSH
even from a Linux to a Windows machine whatever I say on the SSH
client command line would be the same as me doing a command on the
"DOS" command-line in Windows. I incorrectly thought SSH is just a
tunnel for text...

But that's not what's going on, there's  a lot more to it. Thanks, I
will get into it more to understand this.

[toc] | [prev] | [next] | [standalone]


#22540

FromEmile van Sebille <emile@fenx.com>
Date2012-04-02 14:04 -0700
Message-ID<mailman.1234.1333400702.3037.python-list@python.org>
In reply to#22482
On 3/27/2012 5:51 PM goldtech said...
> Hi,
>
> I have a WinXP PC running an SSH server and I have a Linux PC with an
> SSH client  and logged into the XP seemingly OK. It's all on my
> personal LAN, the connection seems OK.
>
> I have a py file on the XP that I run via SSH from the Linux, it's:
>
> import webbrowser
> webbrowser.open('www.google.com')
>
> This runs OK started on the local XP PC, the browser Firefox opens and
> goes to the site, or it opens a tab to the site. But executing that
> same file via SSH does not open Firefox...doing it via SSH starts
> Firefox ( I see it begin in the process manager and I see web
> activity) but Firefox does not open it's window.
>
> Why the does the window not open when the script is started remotely?

Just a guess here, but I expect that Firefox requires some sort of 
graphics device to write on that the ssh shell doesn't provide.

Emile

[toc] | [prev] | [next] | [standalone]


#22554

FromJerry Hill <malaclypse2@gmail.com>
Date2012-04-02 19:17 -0400
Message-ID<mailman.1245.1333408669.3037.python-list@python.org>
In reply to#22482
On Tue, Mar 27, 2012 at 8:51 PM, goldtech <goldtech@worldpost.com> wrote:
> I have a WinXP PC running an SSH server and I have a Linux PC with an
> SSH client  and logged into the XP seemingly OK. It's all on my
> personal LAN, the connection seems OK.
>
> I have a py file on the XP that I run via SSH from the Linux, it's:
>
> import webbrowser
> webbrowser.open('www.google.com')
>
> This runs OK started on the local XP PC, the browser Firefox opens and
> goes to the site, or it opens a tab to the site. But executing that
> same file via SSH does not open Firefox...doing it via SSH starts
> Firefox ( I see it begin in the process manager and I see web
> activity) but Firefox does not open it's window.
>
> Why the does the window not open when the script is started remotely?

How are you running the ssh server on the windows machine?  Is it a
windows service?  If so, what user does it run as, and is the service
configured to be allowed to interact with the desktop?

IIRC, by default most windows services run as a different user than
you, and do not have permission to interact with your desktop session.
 You may be able to get the firefox window to pop up on the ssh server
machine if you allow it to interact with the desktop, assuming that's
what you're trying to do.

Jerry

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web