X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <183c528b0710150618n4059118ehc8291cf6f379b144@mail.gmail.com>
Date: Mon, 15 Oct 2007 09:18:33 -0400
From: "Brian Mathis" <brian.mathis@gmail.com>
To: cygwin@cygwin.com
Subject: Re: How to remotely log in and execute a program
In-Reply-To: <20071013182220.GB8632@suncomp1.spk.agilent.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <13191124.post@talk.nabble.com> <13192157.post@talk.nabble.com> 	 <20071013182220.GB8632@suncomp1.spk.agilent.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 10/13/07, Gary Johnson <garyjohn@spk.agilent.com> wrote:
> On 2007-10-13, ppmoore wrote:
> > Hello again,
> >
> > Just to say that I found a partial solution, by copying the ssh login keys
> > generated on Cygwin on the Windows box to the .ssh directory on the remote
> > Linux box, and then executing from a local Cygwin xterm:
> >   DISPLAY=localhost:0.0 ssh -Y -C -q user@remote-machine "command"
> >
> > But is there a way to do it by running a Cygwin script on the Windows box?
>
> IIUUC, yes, just install the ssh server on your Cygwin/Windows box.
> The instructions are here:
>
>    /usr/share/doc/Cygwin/openssh.README
>
> Regards,
> Gary
>

There's not need for an SSH server on the Windows box.  You only need
the client, as the login is going from Windows to Linux.

To execute a script instead of xterm, just run the script instead! :)
In your command above, forget the "DISPLAY" stuff and put whatever the
name of the command you want to run inside "command".  In most cases,
a simple "ssh user@hostname command" would suffice.  Once you have the
ssh keys set up, you don't even need a password.

Once that is done and working, if you want to run it automatically,
look into "cron".

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

