FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 06-23-2011, 09:19 PM
"Allen, Jack"
 
Default How to configure sshd to automatically do port forwarding

Hello:

I have an Application needs to connect to other systems, login
run an Application and then transfer data to the other Application. This
has been working via a program I wrote years ago called ptsd (Pseudo
Terminal Server). Basically the ptsd program listens on a local port
(127.0.0.1 20000). The Application open a connection to it and then ptsd
prompts for some information and then makes a telnet connection to the
other system and then just becomes a pipe, but handling the telnet
protocol on one side of it.

This need to be changed to use ssh for security reasons. I do
not want to write another program like ptsd to handle the ssh protocol.
I would rather be able to use ssh port forwarding feature to accomplish.
I have done a lot of Googling and found example of using the ssh command
line to do this, but nothing so far to make sshd or ssh do it
automatically. Also the command line example stated there was a
restriction that on one port forwarding per local port number could be
done at a time.

So has anybody else had a need similar to this and was able to
make changes to ssh_config and/or sshd_config to accomplish.

Just to make my request/question clear. The Application need to
be able to establish a simple TCP connection to a local TCP port
(127.0.0.1 20000). When this happen ssh/sshd would automatically make a
ssh connection to a predefine IP address TCP port 22. This way the
connection between Application system is secure and the most that has to
change in the Application is the send/expect values.

-----

Jack Allen

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-25-2011, 10:21 PM
Fran Garcia
 
Default How to configure sshd to automatically do port forwarding

On Thu, Jun 23, 2011 at 23:19, Allen, Jack <Jack.Allen@mckesson.com> wrote:
> Hello:
>
> * * * *I have an Application needs to connect to other systems, login
> run an Application and then transfer data to the other Application. This
> has been working via a program I wrote years ago called ptsd (Pseudo
> Terminal Server). Basically the ptsd program listens on a local port
> (127.0.0.1 20000). The Application open a connection to it and then ptsd
> prompts for some information and then makes a telnet connection to the
> other system and then just becomes a pipe, but handling the telnet
> protocol on one side of it.

You can accomplish this using a config file in the _client_ host, ie:

user@client ~ # cat .ssh/config
Host remotehost
Localforward 20000 localhost:20000

# ssh remotehost
(connect to port 20000 on clienthost and your connections will be crypted :-))

HTH

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-29-2011, 02:03 PM
"Allen, Jack"
 
Default How to configure sshd to automatically do port forwarding

-----Original Message-----
From: redhat-list-bounces@redhat.com [mailto:redhat-list-bounces@redhat.com] On Behalf Of Fran Garcia
Sent: Saturday, June 25, 2011 6:21 PM
To: General Red Hat Linux discussion list
Subject: Re: How to configure sshd to automatically do port forwarding

On Thu, Jun 23, 2011 at 23:19, Allen, Jack <Jack.Allen@mckesson.com> wrote:
> Hello:
>
> * * * *I have an Application needs to connect to other systems, login
> run an Application and then transfer data to the other Application. This
> has been working via a program I wrote years ago called ptsd (Pseudo
> Terminal Server). Basically the ptsd program listens on a local port
> (127.0.0.1 20000). The Application open a connection to it and then ptsd
> prompts for some information and then makes a telnet connection to the
> other system and then just becomes a pipe, but handling the telnet
> protocol on one side of it.

You can accomplish this using a config file in the _client_ host, ie:

user@client ~ # cat .ssh/config
Host remotehost
Localforward 20000 localhost:20000

# ssh remotehost
(connect to port 20000 on clienthost and your connections will be crypted :-))

HTH

[Jack Allen] Thanks for the information, but I think you have misunderstood my requirement. The Application cannot execute ssh, it must just establish a plain TCP connection to a local TCP port and then have a program automatically start a ssh connection to the remote system. And user will be doing this through the Application and the Application will automatically do it at scheduled times. So it needs to look something like this.

Application <-simple-> (Local TCP port, Program or ssh) <-secure-> Remote System

-----
Thanks:
Jack Allen

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-29-2011, 10:09 PM
David Bear
 
Default How to configure sshd to automatically do port forwarding

On Wed, Jun 29, 2011 at 7:03 AM, Allen, Jack <Jack.Allen@mckesson.com>wrote:

> -----Original Message-----
> From: redhat-list-bounces@redhat.com [mailto:
> redhat-list-bounces@redhat.com] On Behalf Of Fran Garcia
> Sent: Saturday, June 25, 2011 6:21 PM
> To: General Red Hat Linux discussion list
> Subject: Re: How to configure sshd to automatically do port forwarding
>
> On Thu, Jun 23, 2011 at 23:19, Allen, Jack <Jack.Allen@mckesson.com>
> wrote:
> > Hello:
> >
> > I have an Application needs to connect to other systems, login
> > run an Application and then transfer data to the other Application. This
> > has been working via a program I wrote years ago called ptsd (Pseudo
> > Terminal Server). Basically the ptsd program listens on a local port
> > (127.0.0.1 20000). The Application open a connection to it and then ptsd
> > prompts for some information and then makes a telnet connection to the
> > other system and then just becomes a pipe, but handling the telnet
> > protocol on one side of it.
>
> You can accomplish this using a config file in the _client_ host, ie:
>
> user@client ~ # cat .ssh/config
> Host remotehost
> Localforward 20000 localhost:20000
>
> # ssh remotehost
> (connect to port 20000 on clienthost and your connections will be crypted
> :-))
>
> HTH
>
> [Jack Allen] Thanks for the information, but I think you have misunderstood
> my requirement. The Application cannot execute ssh, it must just establish a
> plain TCP connection to a local TCP port and then have a program
> automatically start a ssh connection to the remote system. And user will be
> doing this through the Application and the Application will automatically do
> it at scheduled times. So it needs to look something like this.
>
> Application <-simple-> (Local TCP port, Program or ssh) <-secure-> Remote
> System
>
>
You may want to reconsider this and think about use stunnel. I don't know if
you need to 'authenticate' to the remote host. I sounds more like you just
want to send bits out a socket to a remote host in a secure way. stunnel
will let you do that without the need to have an account authentication the
way ssh does


--
David Bear
College of Public Programs at ASU
602-496-0424
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 10:40 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org