On Tue, 01 Jul 2003, Devdas Bhagat wrote:

> On 27/06/03 18:01 -0500, Dagmar d'Surreal wrote:
> <snip>
> > > I have a requirement were I need to connect to a remote machine and
> > > get a command prompt. We all know how to do this via netcat by
> > > setting up a listening port. My concern is that I do not want to
> > > leave the port open for anyone to connect.
> > 
> > Your concern is warranted.  It's never a good idea to just leave ports
> > open that blindly accept commands from anyone around the globe, no
> > matter how "secret" the port number used may be.
> Cryptcat may be useful as well.
> 
> <snip> 
> > *can* be run on a Win32 machine, which would solve your problem nicely
> > once you find a consultant able to build it for you using Cygwin.  Of
> Prebuilt packages are available online. You can just download and
> install those.

and this short guide explains how to get sshd running as a service

http://tech.erdelynet.com/cygwin-sshd.html

use public key authentication and you don't even need to mess with
passwords (see the ssh and sshd docs including ssh-keygen)

If you are using netcat for two-way communication, I suggest
port-forwarding to forward a firewalled local port (again see the ssh docs).

If it is only one way communication, just use a pipe (in a unix shell
which also comes with cygwin) to send characters from one app to the
other.  Very simple - no need to read docs!

1-way from local to remote
==========================
localapp | ssh remotehost "remoteapp"

for example 

cat logmessage.txt | ssh remotehost "cat >> mylog.txt"

1-way from remote to local
=========================
ssh remotehost "remoteapp" | localapp

for example

ssh remotehost "net user" |  cat > accountsonremotehost.txt

Hope this helps


---------------------------------------------------------------------------
Evaluating SSL VPNs' Consider NEOTERIS, chosen as leader by top analysts!
The Gartner Group just put Neoteris in the top of its Magic Quadrant,
while InStat has confirmed Neoteris as the leader in marketshare.
     
Find out why, and see how you can get plug-n-play secure remote access in
about an hour, with no client, server changes, or ongoing maintenance.
          
Visit us at: http://www.neoteris.com/promos/sf-6-9.htm
----------------------------------------------------------------------------

Reply via email to